pda4me
asked on
Actionscript 2.0 Stop frames from advancing until video is loaded in Flash CS3
I am using the following actionscript 2.0 on the first frame of my flash movie to not play the .flv until its 50% loaded. This works great but the rest of the movie advances as that preloads. How do I stop the advance of the flash movie as well until the .flv loads 50%?
Can anyone update the actionscript below to also stop the advance of the flash movie please so I can see how its done? FYI, I plan on having a movie clip on another layer saying LOADING... while this runs...
Can anyone update the actionscript below to also stop the advance of the flash movie please so I can see how its done? FYI, I plan on having a movie clip on another layer saying LOADING... while this runs...
import mx.video.*;
var listenerObject:Object = new Object();
my_FLVPlybk.progressInterval = 001;
my_FLVPlybk.autoPlay = false;
listenerObject.progress = function(eventObject:Object) :Void {
var perc = Math.floor(eventObject.bytesLoaded * 100 / eventObject.bytesTotal);
//implement you loading visual representation here
if(perc == 50)
my_FLVPlybk.play();
}
my_FLVPlybk.addEventListener("progress", listenerObject);
my_FLVPlybk.load("final.flv");
ASKER
close, but that essentially stops the advance of the movie for good. I think I need to adjust the code to stop and then play once its loaded.
oh, I guess i didnt' see that part of the question...
you need to add a new event listener...
listenerObject.complete = function(eventObject:Objec t) :Void {
my_FLVPlybk.play();
}
my_FLVPlybk.addEventListen er("comple te", listenerObject);
rp
you need to add a new event listener...
listenerObject.complete = function(eventObject:Objec
my_FLVPlybk.play();
}
my_FLVPlybk.addEventListen
rp
ASKER
I already have this in my original actionscript to a degree, I don't see where this will advance the frames? I pasted this in, left the stop(); on the first frame and it did not work? Can you send me what you mean in a sample using a updated version of my actionscript?
Thanks for your help.
Thanks for your help.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ahhh, I must have misread the question then...
glad you figured it out...
rp
glad you figured it out...
rp
yeah, that is what I did... the question title threw me off...
"Actionscript 2.0 Stop frames from advancing until video is loaded in Flash CS3"
I must have had that stuck in my brain... and ignored the 50% part.
rp
"Actionscript 2.0 Stop frames from advancing until video is loaded in Flash CS3"
I must have had that stuck in my brain... and ignored the 50% part.
rp
ASKER
Cool, thanks. Will do on assign points in the future. Getting back into flash from a long hiatus (version 4.0) and I am going to need some support, so much has changed but for the better...so much more you can do with flash now!
yep, and I would highly recommend just jumping directly into AS 3. Don't learn a programming model that is no longer the standarc (AS 2.0)
good luck
rp
good luck
rp
ASKER
Sounds good thanks. How long has AS3 been around? Is there anything new (AS4?) coming on the horizon soon?
I think about 1.5 years now... I can't imagine Adobe rewriting the framework yet again, because it has had some significant improvements, and is much more like Java now. Maybe in a year or so they will add some functionality and classes, but I don't forsee a complete switch in programming methodology any time soon.
rp
rp
ASKER
cool, thanks for the info!
put a stop(); command on the frame.
rp