THEwagner
08-16-2006, 10:17 PM
I have a preloader that works fine until the SWF I’m loading contains an embedded FLV. The offending SWF starts to play before the preloader gets to 100% (not cool at all).
How can I correct this? Thanks!
stop();
_root.preLoader._visible = false;
/*******************<Sounds>**********************************************/
_root.globalSound = new Sound();
/************************************************** *******************/
//init
var myMCL = new MovieClipLoader();
/************************************************** *******************/
//
myMCL.onLoadProgress = function (targetMC, loadedBytes, totalBytes) {
_root.preLoader._visible=true;
//
//the following is an example of the maths you might use for the preload bar
perLoaded = Math.ceil((loadedBytes/totalBytes) * 100);
BarWidth = int(perLoaded/2);
_root.preLoader.loadBar._width = BarWidth;
//
_root.preLoader.percText.text=(perLoaded+"%");
}
myMCL.onLoadInit = function (targetMC)
{
_root.preLoader._visible=false;
}
/************************************************** ******************/
buttonMC.onRelease=function() {
//load the file
myMCL.loadClip("test2.swf","_root.emptyMC");
}
How can I correct this? Thanks!
stop();
_root.preLoader._visible = false;
/*******************<Sounds>**********************************************/
_root.globalSound = new Sound();
/************************************************** *******************/
//init
var myMCL = new MovieClipLoader();
/************************************************** *******************/
//
myMCL.onLoadProgress = function (targetMC, loadedBytes, totalBytes) {
_root.preLoader._visible=true;
//
//the following is an example of the maths you might use for the preload bar
perLoaded = Math.ceil((loadedBytes/totalBytes) * 100);
BarWidth = int(perLoaded/2);
_root.preLoader.loadBar._width = BarWidth;
//
_root.preLoader.percText.text=(perLoaded+"%");
}
myMCL.onLoadInit = function (targetMC)
{
_root.preLoader._visible=false;
}
/************************************************** ******************/
buttonMC.onRelease=function() {
//load the file
myMCL.loadClip("test2.swf","_root.emptyMC");
}