因为要用Flex开发一个PhotoExplore工具,用来查看图片。但是又不想动态交互信息。那只有通过在<object>或者<embed>参数中传输特定的参数,使用as3进行读取。
通过调查,可以使用FlashVars这个参数。
具体的应用见Flex3 Builder参考文档:《Passing request data with flashVars properties 》
我这里简单说明一下:
从两个方面可以得到数据:
1,从请求URL里面得到
2,从FlashVars中得到。
FlashVars实例参考:
定义FlashVar 通过AC_FL_RunContent脚本。
AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars","copyright=GeeWuPhotoExplore&xml=<photo name='111' course='TEST'><smallpic>http://localhost:3000/ImagePlayer/flex_bin/test/p_w_picpaths/01_small.jpg</smallpic><bigpic>http://localhost:3000/ImagePlayer/flex_bin/test/p_w_picpaths/01_small.jpg</bigpic><smallpic>http://localhost:3000/ImagePlayer/flex_bin/test/p_w_picpaths/02_small.jpg</smallpic><bigpic>http://localhost:3000/ImagePlayer/flex_bin/test/p_w_picpaths/02.jpg</bigpic><smallpic>http://localhost:3000/ImagePlayer/flex_bin/test/p_w_picpaths/03_small.jpg</smallpic><bigpic>http://localhost:3000/ImagePlayer/flex_bin/test/p_w_picpaths/03.jpg</bigpic></products>",
"width", "${width}",
"height", "${height}",
"align", "middle",
"id", "${application}",
"quality", "high",
"bgcolor", "${bgcolor}",
"name", "${application}",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
读取数据信息:
var copyright:String = Application.application.parameters.copyright;
转载于:https://blog.51cto.com/geewu/183520