html页面代码
mxml文件中的代码
引入swfobject.js
..var swfVersionStr = "10.0.0";
var xiSwfUrlStr = "playerProductInstall.swf";
var flashvars = {};
var params = {};
flashvars.xxxxxx = "参数值"; //设置参数
flashvars.yyyyyy = "参数值";
flashvars.zzzzzzz = "参数值";
flashvars.locale = '${locale}';
params.quality = "high";
params.bgcolor = "#ffffff";
params.allowscriptaccess = "sameDomain";
params.allowfullscreen = "true";
params.wmode = "opaque";//屏蔽系统右键菜单的关键
var attributes = {};
attributes.id = "flashId";
attributes.name = "flashId";
attributes.align = "middle";
if (swfobject.hasFlashPlayerVersion("10")) {
swfobject.embedSWF("flashId.swf", "flashContent","100%", "100%", swfVersionStr, xiSwfUrlStr,flashvars, params, attributes);
swfobject.createCSS("#flashContent", "display:block;text-align:left;");
}.
...
mxml文件中的代码
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="800" minHeight="450" creationComplete="callLater(init)"
xmlns:component="com.yotc.opviewweb.view.component.*"
xmlns:twextends="com.yotc.opviewweb.view.component.twaverextends.*"
>
<fx:Script>
...
private function init():void
{
pageParam = FlexGlobals.topLevelApplication.parameters;
//获取参数
//pageParam.xxxxxx
}
...
</fx:Script>
</s:Application>