preloader and onMotionFinished problem
hello, I've been working on a site for some time now and I just created a preloader for the swf, at the same time as its preloading the swf will do tween on a object but heres the problem:
When the preloader is done it will jump to the other frame (frame 2) and it wont complete the tween unless you have to load longer then the tween is so I though I would also use an onMotionFinished but it doesnt work, this is how it looks like:
Code:
var slide:Tween = new Tween(holder, "_x",Regular.easeOut, 800, Stage.width / 2, 0.5, true);
this.onEnterFrame = function() {
var amount:Number = this.getBytesLoaded() / this.getBytesTotal() * 100;
holder.loader._xscale = amount;
var loader_text = Math.floor(amount);
holder.load_text.text = loader_text + "%";
if(amount == 100) {
slide.onMotionFinished = function() {
this.gotoAndStop(2);
delete this.onEnterFrame;
}
}
}
I cant really figure out how to fix this so would really appreciate if someone could point me to the right direction.