Hi Glen,
thanks, but that's exactly what I do, but it answers not the related questions:
a) what, if I need the video for a second DisplayObject at the same
time on stage, does it load faster, because it was cached?
b) play() and pause() leads to unwanted sound behaviors when the video
consists of sound
c) how to set the video to the real size? I always need to wait for
metadata, which is really ugly. Otherwise the video is set to default
320x480.
Any thoughts?
Is it perhaps possible to load the FLV as ByteArray and later load the
Netstream from this ByteArray, which might be faster and done a second
time, too?
Matthias
On Jan 21, 2008 10:52 AM, Glen Pike <[EMAIL PROTECTED]> wrote:
> 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
> > [email protected]
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> >
> >
>
> --
>
> Glen Pike
> 01736 759321
> www.glenpike.co.uk <http://www.glenpike.co.uk>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders