如何从 flash vars 接收数组?
如何从 flash vars 接收数组?
所以我有 HTML 页面。上面有一个 Flash 应用程序。我想发送一个数组到闪存。
我如何使用 flashVars 来做这样的事情(我有类似 uid=12&sid=12&sid=32&sid=12&sid=32 的东西)所以我需要获得动态\随机\beeg\未知数量的 Sid 而不是丢失 UID。这样的事该怎么办呢?
顺便说一句,我想传递一个值数组并让 Flash 将其识别为数组对象;
例如,对于 POST 和 GET 请求,数组的形式为“field[]=value&field[]=value”等。
How do I receive an array from flash vars?
So I have HTML page. with a flash app on it. I want to send an array to flash.
How do I do such thing using flashVars (I have something like uid=12&sid=12&sid=32&sid=12&sid=32) so I need to get dynamic\random\beeg\unknown number of Sid's while not losind UID. How to do such thing?
btw I want to pass in an array of values and have it recognized by Flash as an Array object;
For example, with POST and GET requests an array is formed as "field[]=value&field[]=value" etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您可以将 sid 连接成逗号分隔的字符串,那么您可以在操作脚本中将它们拆分。
If you could join the sid's into a comma-delimited string, then you could split them in the actionscript.
我很困惑,你想向你的Flash电影发送参数还是接收参数?如果你想像我怀疑的那样发送它们,那么它们首先是如何生产的?是来自其他页面上的 HTML 表单吗?
您可以使用 PHP 或 JavaScript 来使用传递的参数构建 HTML。
这是 JavaScript 中的答案,取自 http://nscope.com/journal/2003/ 12./query_string 并稍加修改。
I'm confused, you want to send parameters to your flash movie or receive? And if you want to send them as I suspect, how are they produced in the first place? Is it from an HTML form on some other page?
You can use PHP for this or JavaScript that will construct your HTML with the parameters passed.
This is your answer in JavaScript, taken from http://noscope.com/journal/2003/12./query_string and slightly modified.
“如何从闪存变量接收数组?”
应用程序.应用程序.参数。
"How to recive an array from flash vars?"
Application.application.parameters.
在这种情况下,我通常创建一个动态生成的 XML 文件并将 url 作为 flashvar 传递给它。
我更喜欢 XML 的原因是我讨厌编写额外的 javascript 来对 flashvar 进行编码,然后编写额外的动作脚本来解析它们。但是,如果您的 Flash 应用程序非常简单并且您不打算向其中添加许多数组/关系,那么请忽略我的答案。 :)
In this situation, I usually create a dynamically generated XML file and pass the url to it as a flashvar.
The reason I prefer XML is that I hate having to write extra javascript which encodes the flashvars and then extra actionscript to parse them. However, if your flash app is very simple and you don't plan on adding many arrays/relationships to it then ignore my answer. :)