kraaft
10-05-2005, 08:33 AM
I use this loader script for practically everything and it's always worked for me until now. I can't see what I've done that would stop it working as it still works fine in other parts of the movie?!
stop();
Stage.align = "LT";
orangeCover._width = Stage.width;
myLoadIncrements = Stage.width/100;
Stage.scaleMode = "noScale";
startLoad();
MovieClip.prototype.startLoad = function() {
holder.loadMovie("andrewPrice.swf");
this.onEnterFrame = function() {
percent = (holder.getBytesLoaded()/holder.getBytesTotal())*100;
myPercent = Math.floor(percent);
if (!isNaN(myPercent)) {
orangeCover._width = Stage.width-(myPercent*myLoadIncrements);
}
if (myPercent == 100) {
trace("d0ne");
holder._alpha = 100;
holder.gotoAndStop(2);
delete this.onEnterFrame; //*****this line?!****
}
}
};
It works fine if i leave off the delete this.onEnterFrame at the end but I don't want the onEnterFrame to continue during the rest of the movie!!
If I include the delete this.onEnterFrame the loading bar(orangeCover) reduces instantly and none of the final code works so the movie doesn't play...
any ideas appreciated....
stop();
Stage.align = "LT";
orangeCover._width = Stage.width;
myLoadIncrements = Stage.width/100;
Stage.scaleMode = "noScale";
startLoad();
MovieClip.prototype.startLoad = function() {
holder.loadMovie("andrewPrice.swf");
this.onEnterFrame = function() {
percent = (holder.getBytesLoaded()/holder.getBytesTotal())*100;
myPercent = Math.floor(percent);
if (!isNaN(myPercent)) {
orangeCover._width = Stage.width-(myPercent*myLoadIncrements);
}
if (myPercent == 100) {
trace("d0ne");
holder._alpha = 100;
holder.gotoAndStop(2);
delete this.onEnterFrame; //*****this line?!****
}
}
};
It works fine if i leave off the delete this.onEnterFrame at the end but I don't want the onEnterFrame to continue during the rest of the movie!!
If I include the delete this.onEnterFrame the loading bar(orangeCover) reduces instantly and none of the final code works so the movie doesn't play...
any ideas appreciated....