PDA

View Full Version : Preloader:embedded FLVs cause havoc


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");
}

DarthJay
08-17-2006, 05:32 AM
The offending SWF that you're loading in, is the FLV embedded in it - or is it calling it externally? If it's making an external call, I would guess it's going the start loading in the FLV according to the offending SWF's buffer time reguardless of what other movies still need to load into the main timeline. You may need to set some code in the parent movie that tells the FLV not to play until everything is loaded. Does that make sense?

THEwagner
08-17-2006, 02:45 PM
Thanks Darth,
The FLV is embedded in the timeline. Does the code you refer to prevent embedded FLV's from playing or only externaly loaded ones? Regardless, I would be interested in taking a look at the code. The more I think about it, I get the feeling that I'm going to have to load this externally. :(