flash actionscript:
Hello, thanks to anyone who can help. I built a video presentation in slide
format from a tutorial. I'm trying to make a seperate pre-loader movie (so it
can be used more than once) that loads the entire presentation swf before it
starts playing and loads it. I think I just need to define the target properly
but everything I've tried doesn't work. Here is the script:
/*
preloader.as
Used to preload movies from frame one. Classes are set to export on frame two
and this is on frame one so it is not a class.
*/
// Declare the loader assets.
var right:MovieClip;
var middle:MovieClip;
var left:MovieClip;
var track:MovieClip;
// Maxiumum width of the middle piece.
var middleMaxWidth:Number;
function init():Void
{
middleMaxWidth = track._width - right._width;
// Monitor the loading progress of the parent movie.
onEnterFrame = function()
{
var bl = _parent.getBytesLoaded();
var bt = _parent.getBytesTotal();
if (bl > 4 && bt > 4 && bl >= bt) // Loading is complete.
{
delete onEnterFrame;
_parent.gotoAndPlay(2);
this.unloadMovie();
}
else
{
middle._width = Math.round(bl / bt * middleMaxWidth);
right._x = middle._x + middle._width;
}
}
}
init();
End Script.
I'm pretty sure that where the _parent is getting the bytes is where I should
define my two movies. The main movie I'm trying to load is called
index_flashNoVideo.swf and the preloader movie itself is just preloader.swf.
Anyone have any ideas?
The action script file is external and is called in the first frame of the
preloader movie using the same preloader animation as on the flash video
gallery tutorial. If that helps any.
Thanks again to anyone who might have any insight on this.