Groups | Blog | Home
all groups > flash (macromedia) > june 2007 >

flash (macromedia) : Have the flash video activate a function at the end of the movie


MichaelLR
6/7/2007 9:04:34 PM
I have a movie that when it finishes playing I want a function to happen.
It is a tutorial movie and I want to require the viewer to watch the whole
video before
they can click on the html to go to the next page. How do I do that?

Thank you.
nickterbeeman
6/15/2007 2:20:43 PM
var vidList : Object = new Object();
vidList.complete = function() {
_level0.play(); gotoAndPlay("37");
}
vid.addEventListener ("complete",vidList);
MichaelLR
6/15/2007 2:52:57 PM
Thank you, nickterbeeman.

As a newbee to flash, where do I put the code you posted?

Nickels55
6/15/2007 3:49:45 PM
Just to help you out a bit, that code goes on the frame containing the FLV
component, but do not attach it to the component. Then, make sure you click on
the component and give it an instance name of vid in the properties window.

You can change this part of the code:
-----------------------------
_level0.play(); gotoAndPlay("37");
-----------------------------
to whatever you want to happen when the movie ends.
MichaelLR
6/18/2007 8:49:50 PM
Hi Nickterbeenan and Nickels55.

I very much appreciate the help, and I have looked over this code, inserted
the action script in the keyframe where the video resides, but I'm at a loss at
what part I change to enable a js function to occur. Specifically, I want a
"Next" button not to be activated (functional) until the last frame of the
video is played.

It looks like you have provided the code, but when Nichels55 states:

You can change this part of the code:
-----------------------------
_level0.play(); gotoAndPlay("37");
-----------------------------
to whatever you want to happen when the movie ends.

I'm not sure what part of that code I can change. I do have a js coder on
board with me. All I need to tell
him is where, how and what he puts in the code to make his js do its magic.

Your help is much appreciated, thank you.

Michael
AddThis Social Bookmark Button