I am trying to add instances of the same library item on stage with tweening. Each one will “appear” on stage with delay.
I have this code so far:
import com.greensock.TweenLite;
var itemsList:Array = new Array();
init();
function init():void{
for (var i:int = 0; i<6 ;i++){
var item:Milk = new Milk();
addChild(item);
itemsList.push(item);
}
for each (var m:Milk in itemsList){
//TweenLite.to(Milk(m), .5, {x:"100",alpha:0, delay: m / 6}); ---this gives error!!!
//Milk(m).x=200; ---This works
}
trace(itemsList.length);
}
The following error: 1067: Implicit coercion of a value of type Milk to an unrelated type Number.