AS3 - How do you receive parameters in a swf from a GET request?

孤者浪人 提交于 2019-12-13 05:19:27

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/3673660/as3-how-do-you-receive-parameters-in-a-swf-from-a-get-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!