…because it just won’t die, here is some more AS2 for you.
stop();
function playClip(){gotoAndPlay(2)};
function newPrct()
{
var prct:Number = Math.floor( ( this.getBytesLoaded() / this.getBytesTotal() ) * 100 );
( prct == 100 )?playClip():setTimeout( function(){newPrct();},250 );
}
newPrct();
I go into more detail after the jump.
// stop the movie before it starts.
stop();
// simple go to this frame and play function
function playClip(){gotoAndPlay(2)};
// set the variable for PERCENT
var prct:Number = 0;
// the function to check the percentage loaded.
function newPrct()
{
// find the PERCENT by dividing loaded by total bytes.
prct = Math.floor( ( this.getBytesLoaded() / this.getBytesTotal() ) * 100 );
// trace out the PERCENT
trace( "\t"+prct );
/*
simple IF / ELSE -
if PERCENT is 100, play the "playClip" function
or run this function again in a quarter of a second.
*/
( prct == 100 )?playClip():setTimeout( function(){newPrct();},250 );
}
// start it off!
newPrct();
