Flash获取外部参数


1. 修改加载flash的html页面,找到第二个AC_FL_RunContent 中的代码内容,代码如下:
AC_FL_RunContent(
"src""${swf}",
"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"
);

2. 在"pluginspage", "http://www.adobe.com/go/getflashplayer"位置后,加上代码("flashvars","youParmName=youValue"),即如下:
AC_FL_RunContent(
"src""${swf}",
"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",  
  "flashvars","youParmName=youValue"
);

3.Flex获取外部参数。
     获取某一参数:
         Application.application.parameters["youParamName"]; 
    获取所有的参数:
        var str : String = "";
        for (var i:String in Application.application.parameters)
       {
           str += i + ":" + Application.application.parameters[i] + "\n";
        }
          
        Alert.show(str);

posted @ 2008-04-28 10:27  有容乃大  阅读(4257)  评论(0编辑  收藏  举报