Performing an action when the video is complete
December 23rd, 2007 . by polyGeekIt’s pretty simple to perform some action when a video completes playing. You use the videoMaruCreationComplete function to set a callback - videoMaru.setOnVideoComplete( fn ) - to some function that you would like to run when your video finishes playing.
Here is a simple example that is fully commented. Hopefully you can follow this template to do what ever you need to do.
| Download Example FLA |
Here is the code that enables this. You’ll need to look inside the FLA to understand the layer structure and read the comments.
function videoMaruCreationComplete():Void {
videoMaru.setOnVideoComplete( theVideoIsOver );
}
//
function theVideoIsOver():Void {
this._parent._parent.gotoAndStop( "videoOver" );
}
