AS3 - 从一个GET请求的SWF你怎么接收参数?你怎么、参数、GET、SWF

2023-09-08 15:28:04 作者:浪漫归属者

我试图用 VAR params:一个对象=((this.stage.loaderInfo)为的LoaderInfo).parameters; 得到的参数,但它返回一个对象,没有属性。但如果我使用与LoaderInfo.url那的LoaderInfo会给我正确的URL没有参数。我使用的要求: HTTP://localhost/foo.swf开始= foobar的。 params.hasOwnProperty(开始)没有返回值,并使用循环显示,PARAMS没有属性。我如何收到启动/ foobar的对我的code?我更preFER不使用Flash变量,由于我们的设置。

I tried using var params: Object = ((this.stage.loaderInfo) as LoaderInfo).parameters; to get the parameters, but it returns an Object with no properties. That LoaderInfo will give me the correct URL without the parameters though if I use LoaderInfo.url. I'm using the request: http://localhost/foo.swf?start=foobar. params.hasOwnProperty("start") returns nothing, and using a for loop shows that "params" has no properties. How do I receive the start/foobar pair in my code? I would much prefer to not use FlashVars due to our setup.

推荐答案

通常你必须嵌入SWF到HTML文档中,然后访问URL字符串为您介绍。

Usually you must embed the SWF into an HTML document, then access the url string as you describe.