PDA

Click to See Complete Forum and Search --> : detecting end of loaded video swf



jazstewart
08-08-2002, 11:46 AM
First time caller... Long time listener.

I have a SWF created via Sorenson Spark Pro, I'm using loadMovie to load it into my Flash file. How can I detect when the loaded SWF is done playing? I obviously can't crack open the SWF and add actionscript, so I need a way to detect when it's done.

Any ideas?
Thanks in advance...

-jaz

Jonathan_B
08-08-2002, 03:24 PM
Hi.
You can use get property to tell you how many total frames are in the movie you have loaded. Then you can compare how many frames have played against the total. When those numbers are equal, you know that your swf is done playing.
FYI, our software, Flix, adds a variable at the end of each swf to let you know when it is done playing.
jb

http://www.wildform.com/flix

jazstewart
08-08-2002, 04:48 PM
I understand the getProperty part, that's easy. But I'm not very good with loops. How would the logic look?

Is it like this?

if (_currentframe = _totalframes) {
do something()
}

And, where does it need to go? I placed my getProperty within an onClipEvent(), on the MC that loads the SWF, and it works. I'm just not sure where to put the other logic.

Any Ideas?
Thanks in advance...

-Jaz

Wheels
08-12-2002, 04:34 AM
<b>// on a MC</b>

on(press){
loadMovie("mySwf", 4000);
}

<b>// dynamic</b>

mc.onPress = function() {
loadMovie("mySwf", 4000);
}

<b>// on a MC</b>

onClipEvent(enterFrame){
if(_level4000._currentframe==_level4000._totalfram es)
doSomething;
}
}

<b>// dynamic</b>

mc.onEnterFrame = function() {
if(_level4000._currentframe==_level4000._totalfram es){
doSomething;
delete this.onEnterFrame;
}
}
http://www.tcinternet.net/users/5guys/test308/final3.html

5G
[Edited by Wheels on 08-16-2002 at 04:10 AM]