I’ve a strange problem. I defined a movieclip prototype for tweening.
MovieClip.prototype.tweening = function(destination) {
this.destinationX = destination;
this.onEnterFrame = function() {
var distance = this.destinationX-this._x;
this._x += distance/5;
};
};
Two arrays for clips location and clips
defaultLocation = [ 252.8, 338.5, 400.6, 454.8, 539.5 ];
left01Clips = [clip_01, clip_02, clip_03, clip_04, clip_05];
I defined another function to restore the location of the clips and call the function.
function restoreLocation (){
for ( i=0; i<left01Clips.length; i++ ) {
left01Clips*.tweening(defaultLocation*);
}
}
restoreLocation () //It's not working.
But we call this function using a button some thing like this it’s working. what is going wrong with this.
myButton.onRelease = function () {
restoreLocation () ;
}