Skip to main content
Participant
January 20, 2010
Answered

Preloader: frame 1 stop, on 100% goto frame 2 (AS2)

  • January 20, 2010
  • 1 reply
  • 808 views

Hello all,

at first, I thought I could manage this myself searching the forums about "preloader" but none of the solutions seem to work. I think it has to do with the fact that I'm using the FLVPlayer with an external file.

What am I looking for?

1. Well, the preload code for frame 1 that makes sure the external F4V (movie.f4v in the same dir) is loaded 100% before it jumps to frame 2 where the movie should start playing...

2. If possible, a progress bar.

I'll keep on trying but I'm afraid I need your help since I can't get it working...

thanks all !

This topic has been closed for replies.
Correct answer kglad

use:

stop()

var lo:Object = new Object();
lo.progress = function(eo:Object):Void {
// use eo.bytesLoaded and eo.bytesTotal for your progress bar

if(eo.bytesLoaded==eo.bytesTotal){

gotoAndStop(2);

}
};
flv.addEventListener("progress", lo);
flv.load("yourvid.f4v");

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
January 20, 2010

use:

stop()

var lo:Object = new Object();
lo.progress = function(eo:Object):Void {
// use eo.bytesLoaded and eo.bytesTotal for your progress bar

if(eo.bytesLoaded==eo.bytesTotal){

gotoAndStop(2);

}
};
flv.addEventListener("progress", lo);
flv.load("yourvid.f4v");

Participant
January 20, 2010

wow that was fast. I'll try it out right away. You don't have the same code for AS3?

I would love to compare them since I'm learning AS3 too !

And the progressbar is just dragging the buffering bar component on it and giving it the same instance name, being... lo then?

Thanks...