AS3 - 从一个GET请求的SWF你怎么接收参数? [英] AS3 - How do you receive parameters in a swf from a GET request?

查看:246
本文介绍了AS3 - 从一个GET请求的SWF你怎么接收参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用 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.

这篇关于AS3 - 从一个GET请求的SWF你怎么接收参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆