将一系列Sprite传递给Actionscript 3中的Tweener类的语法是什么?

时间:2021-11-29 19:11:43

This works:

Tweener.addTween( [ _fee, _fye, _fum ] , { alpna:1, time:10 });

But this does not:

但这不是:

var _myArray:Array = new Array( [ _fee, _fye, _fum ] );
Tweener.addTween( _myArray , { alpna:1, time:10 });

How can I pass the an array straight into the tweener?

如何将阵列直接传递到tweener?

1 个解决方案

#1


0  

you should call the constructor like this:

你应该像这样调用构造函数:

var _myArray:Array = new Array(_fee, _fye, _fum);

what you did, is construct an Array, that contains an Array of MovieClips ... just as a side note: personally, i see no advantage of not using the literal, as in the first case ... sometimes it is even better, because it is less ambigous ... for example new Array(5) will construct an Array of length 5, whereas new Array(myObject) will construct an Array containing myObject ...

你做了什么,是构建一个Array,其中包含一个MovieClip数组......就像一个旁注:个人而言,我认为没有使用文字的优势,就像在第一种情况下......有时甚至更好,因为它不太暧昧...例如new Array(5)将构造一个长度为5的Array,而new Array(myObject)将构造一个包含myObject的Array ...

#1


0  

you should call the constructor like this:

你应该像这样调用构造函数:

var _myArray:Array = new Array(_fee, _fye, _fum);

what you did, is construct an Array, that contains an Array of MovieClips ... just as a side note: personally, i see no advantage of not using the literal, as in the first case ... sometimes it is even better, because it is less ambigous ... for example new Array(5) will construct an Array of length 5, whereas new Array(myObject) will construct an Array containing myObject ...

你做了什么,是构建一个Array,其中包含一个MovieClip数组......就像一个旁注:个人而言,我认为没有使用文字的优势,就像在第一种情况下......有时甚至更好,因为它不太暧昧...例如new Array(5)将构造一个长度为5的Array,而new Array(myObject)将构造一个包含myObject的Array ...