如何将 flashVars 传递到 Flash,然后作为查询字符串返回
我作为一个完全的 Flash 新手问这个问题,所以请指出我在这里是否做错了什么(我怀疑我是)。
我有一个 Flash MPU 大小的动画,其中有一个链接,该动画是通过使用全尺寸透明层作为按钮(这是正确的方法)和以下 ActionScript 创建的:
on(release){
getURL("/account/", "_self")
}
我想做的是将一些 flashVars 传递给Flash,然后将它们作为查询字符串附加。我尝试过这样的方法:
on(release){
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
getURL("/account/?test="+String(paramObj["test"]), "_self")
}
两件事。首先,我认为这不是检索 flashVar 的正确方法,因此我在这方面需要一些帮助。
第二个问题是链接到的相对 URL 正在删除整个查询字符串 - 所以我不会获取“/account/?test=undefined”。那么如何将查询字符串附加到 URL 中呢?
感谢您的帮助。
I am asking this question as a complete Flash novice, so please do point out if I'm doing anything wrong here (I suspect I am).
I have a Flash MPU size animation with a link in it which has been created by using a full sized transparent layer as a button (is that the correct way) with the following ActionScript:
on(release){
getURL("/account/", "_self")
}
What I would like to do is pass some flashVars in to the Flash and then append them as a query string. I have tried a method like this:
on(release){
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
getURL("/account/?test="+String(paramObj["test"]), "_self")
}
Two things. Firstly I don't think that is the correct way to retrieve the flashVar so I need a bit of help in that respect.
The second problem is that the relative URL being linked to is stripping out the entire query string - so I don't event get "/account/?test=undefined". So how do I actually append the query string to the URL?
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是我之前在 AS2
Javascript
ActionScript-2
中使用 Flashvars 的方式然后你可以使用 xmlPath 或任何你想调用它的 var 做任何事情:)
XML 文件可以是一个字符串,就像您的情况一样。
This is how I used Flashvars before in AS2
Javascript
ActionScript-2
Then you can do whatever with xmlPath or whatever var you want to call it :)
The XML file can be a string like in your case.