发送数组从Flash(AS3)给JavaScript [英] Send array from Flash (AS3) to JavaScript

查看:158
本文介绍了发送数组从Flash(AS3)给JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能使用ExternalInterface的电话从Flash(AS3)给JavaScript发送一个数组?

Is it possible to send an array from Flash (AS3) to JavaScript using an ExternalInterface call?

我目前正在从调用一个函数多次每个'内部闪存循环,但它过得太快了JavaScript来跟上。

I currently am calling a function multiple times from a 'for each' loop inside Flash but it goes too fast for the JavaScript to keep up.

我的想法是创建属性的数组,传递给JavaScript函数,然后遍历,在JavaScript的。

My idea is to create an array of the attributes, pass that to the JavaScript function and then to loop through that in the JavaScript.

谢谢, 约什

推荐答案

另外,使用JSON的建议,这应该是更快的小型阵列,并且不需要使用的eval或外部库来解析的。加入一个字符串数组这样的闪光灯:

Further to the suggestion of using JSON, this should be faster for small arrays and wouldn't require the use of eval or an external library to parse. Join an array in a string like this in flash:

ITEM1 |项目2 |项目3 | ITEM4

item1|item2|item3|item4

传递字符串给JS和采用分体式再次分割它(|)

Pass the string to the JS and split it again using split("|")

这篇关于发送数组从Flash(AS3)给JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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