PDA

View Full Version : When a flash finish...


jolietjake
11-21-2002, 09:07 AM
Hello! I have a problem.

I have a flash animation, and I need when it finished the animation, to run a javascript function. Is there any event that controls the finish of a flash animation?

Thanks

Jolietjake

Membie
11-21-2002, 09:24 AM
See This thread... (http://www.codingforums.com/showthread.php?threadid=10136)

jolietjake
11-21-2002, 09:34 AM
Well, I use a viewletbuilder 3 program. Its a program that makes an animation from a couple of images catched by the user. The 2.x versions makes a java animation, but the version 3 makes a Flash animation, and not permits to the user to put a function inside the last frame (...). So I need to know, in the html, when the flash finish...

Someone told me about

fscommand("string1", "string2")

and

function animac_DoFsCommand(argum1, argum2)

(where animac is the id of the flash id or name), but I don't know how to use it

Someone can help me?

Thanks.

Jolietjake

Membie
11-21-2002, 12:04 PM
If you know how long your animation takes (to load & play),setTimeout... (http://www.devguru.com/Technologies/ecmascript/quickref/win_settimeout.html) could be an option...

jolietjake
11-21-2002, 12:42 PM
HMMM.... is a solution, but has a problem.

I tried to know the length of the flash, but when the computer is close to be out of memory, the flash length in time is not the same as when the computer have lot of memory. So, if I put a timer, the timer perhaps cuts the animation, perhaps its a long time since the animation ended...

Membie
11-21-2002, 11:18 PM
Woooowhhh... How wrong I was

First thing you have to do is get the totall frames of your animation. YES! You can detect the end frame number with This script... (http://webreference.com/js/tips/010616.html) Works fine, trust me ;)

Once you know the last frame number it should be possible to call your function when your animation has reached that last frame (if / else, etc.)

Wish you luck ;)
Javascript amazes me more and more

Membie
11-21-2002, 11:38 PM
Perhaps the attached file makes things easier (to get the last frame number of your animation)