现在,我有许多影片剪辑
在我的阵列。我想更新我的数组中的影片剪辑的所有字母
值。
Right now, I have many MovieClips
's in my array. I want to update all the alpha
values of the MovieClips in my array.
现在,我使用的是循环但这不是这样做的最快方式。
Right now, I am using a for loop but this is not the fastest way to do it.
有没有办法在我的阵列设置中的所有项目的值?
Is there a way to set values for all the items in my array?
谢谢!
没有。 动作
没有任何结构,使您可以用code单行改变数组中的所有元素的属性。有一个 Array.forEach( )
的方法,但我认为这将是比简单的慢为(i = 0; I< LEN;我++)
循环,因为这里调用函数的阵列的每个项的开销
No. ActionScript
doesn't have any constructs that allow you to change properties of all elements of the array with a single line of code. There is an Array.forEach()
method, but I think that would be slower than a simple for(i = 0; i < len; i++)
loop as there is an overhead of calling a function for each item of the array.