Ok,
I got rid of my onLoadInit(), and used the onLoadProgress(). It works
somewhat. The preloader is a fancy ball thingy-ma-jig. Once the preloading
is done the prelaoder plays a simple animation and fades away. Once it
fades away it suppose to play the loaded clip, but the
"targetLoader.gotoAndPlay("close");" never excutes. I used a trace to show
what percent was loaded, and another trace to see if the "if
(preloadContent>=50)" was triggered. The second statement is excuted when
the percent loaded hits 50, but the percent loaded keeps going up to 100
then it stops.
How do I kill the onLoadProgress?
////////////////////////////////////////////////
var my_mc:MovieClipLoader = new MovieClipLoader();
var preloadListener:Object = new Object();
preload = new Object();
preloadListener.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
};
preloadListener.onLoadProgress = function(targetMC, lBytes, tBytes) {
var preloadContent = Math.round((lBytes/tBytes)*100);
trace("% Loaded:"+preloadContent);
targetLoader.gotoAndPlay(preloadContent*2);
if (preloadContent>=50) {
targetLoader.gotoAndPlay("close");
trace("Lets play loaded content");
}
};
my_mc.addListener(preloadListener);
my_mc.loadClip(contentURL, targetClip);
////////////////////////////////////////////////
MikeG
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael
Bedar
Sent: Friday, April 07, 2006 7:22 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Load 40% of target with MovieClipLoader Class
Use onLoadProgress ... wait for whatever percent you want, then play
On Apr 7, 2006, at 8:10 PM, Mike Guerrero wrote:
>
> Question: How can I load only 40% of a target movieclip using the
> MovieClipLoader class?
>
> I have used several times to load swfs, but on a recent project the
> target swfs are over 4MB. So, instead of waiting for all of it to
> load, want it to start playing at around 40%. I am using onLoadInit. I
> think that is firing once the whole swf is loaded. I am probably over
> thinking it.
>
> Staring too much at the code,
> MikeG
>
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training http://www.figleaf.com
http://training.figleaf.com
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.3.5/302 - Release Date: 4/5/2006
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com