Hi,
Steven Sacks posted this the other day.
Glen
"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));
}
} "
Matthias Dittgen wrote:
Hello,
I want to use video for character animations and so I want to preload
several videos without to play them while preloading.
How can I do this in AS3? I found only the play("something.flv")
method. Are there any other possibilities?
Also, I am currently waiting for my metadata handler to be called
before I accept a video as loaded, because I need to set its height
and width, which only works using these values.
video.videoWidth and video.videoHeight doesn't work for me all the time.
And because I have more than one charactor of its kind, do I need to
load the flv as often as many characters I have?
Any suggestions?
Matthias
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
--
Glen Pike
01736 759321
www.glenpike.co.uk <http://www.glenpike.co.uk>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders