Problem with 2 rows arrays
Hello,
In Animate HTML5, I want to associate a createjs.Tween to a clip according to its Y ordinate. The ordinate will be random. For this, I have created 2 arrays. The first table allows to sort the Y ordinates of the clips. The second table contains the names of the clips.
How can we sort the names of the clips according to their ordinate given by the first table?
The code below does not work: it indicates that it is impossible to assign the "tweenjs" property to the ordinate of a clip.
function compare(a, b)
{
return a - b;
};
var chromo1 = [this.myClip0.y, this.myClip1.y, this.myClip2.y, this.myClip2.y];
var chromo2 = [this.myClip0, this.myClip1, this.myClip2, this.myClip3];
chromo1.sort(compare);
createjs.Tween.get(chromo1[1])
.to({x:378, y: 102},4000,createjs.Ease.circOut)
Thanks for any help.
[link removed by moderator]
