Preloading FLVs is easy peasy.

var progressTimer:Timer = new Timer(10);
progressTimer.addEventListener(TimerEvent.TIMER, updateProgress);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
progressTimer.start();
// PLAY IT THEN PAUSE IT
ns.play(path);
ns.pause(true);

private function updateProgress($event:TimerEvent):void
{
dispatchEvent(new ProgressEvent(ProgressEvent.PROGRESS, false, false, ns.bytesLoaded, ns.bytesTotal));
}

private function onNetStreamStatus($event:NetStatusEvent):void
{
    if ($event.info.code == "NetStream.Buffer.Flush")
    {
        progressTimer.stop();
        dispatchEvent(new Event(Event.COMPLETE));
    }
}



Steven Sacks
Flash Maestro
Los Angeles, CA
--
blog: http://www.stevensacks.net
gaia: http://www.gaiaflashframework.com

Glen Pike wrote:
Hi,

   I would suggest loading movie A then do 2 things when it has loaded:

   play movie A
   preload movie B
If Movie A is long enough you can load in all of Movie B before A finishes and then transition as you like.

- by Movie I mean MovieClip / SWF not FLV. There maybe ways to preload FLV's, but I am not familiar with this.

   There are some good "sequential" preloaders out there:

Ralf Bokelberg has a preloader that looks okay. I have never used it because I had written my own already, but it looks very solid.

   http://www.helpqlodhelp.com/stuff/loaderclass/LoaderClass.doc.html

http://www.helpqlodhelp.com/scripts/com.qlod.app.loader.MovieClipLoader.as

There is also a useful article here linking to lots of preloaders / examples:

http://www.actionscripthero.org/blog/2003/07/the-quest-for-preloading-powers.html

   HTH

   Glen
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to