开发者

Get swf parameters in action script 2

开发者 https://www.devze.com 2023-02-14 00:05 出处:网络
How can I get swf parameters using actionscript2? like myflash.swf?p=1 开发者_JAVA技巧or <param name=\"flashvars\" value=\"p=1\" />

How can I get swf parameters using actionscript2? like

myflash.swf?p=1
开发者_JAVA技巧

or

<param name="flashvars" value="p=1" />

Thanks.


If I remember correctly:

<param name="FlashVars" value="example=test"> under the other param tags, and flashvars="example=test" as extra attribute in the embed tag.

The variable will then be globally accessible in the movie.

trace(example) -> output: test


<embed src="myApplication.swf?name1=value1&name2=value2" />

var s:String = stage.loaderInfo.parameters["name2"];


Hey I have the answer to this. Create an intermediate webpage with the parameters you need and get the xml or html. You could write a file with an url and return the url with loadVars. But it needs sinchronization. There should be easier like url parameters or javascript.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号