views:

812

answers:

1

I am including a video within a flash banner. When the banner loads, in the space where the video will play I have prepared 'click to play' graphics, with a button which invokes nextFrame – taking the main flash movie's play head to the frame where the actual video is.

The video then plays fine, but finishes on a blank, black screen.

What I would like is that when the video has finished playing, the main flash movie's timeline will return to the frame with the 'click to play' graphics on it, rather than blank. Can anybody tell me what actionscript (as2) I need to use and where to put it please? Thanks.

+1  A: 

What are you using to display the FLV ? The FLVPlayback Component, the Media Display Component or just the Video, NetSteam and NetConnection classes ?

For the FLVPlayback component for example, you have the FLVPlayback.complete event, but let us know what you use and the rest should be easy.

Assuming FLVPlayback component has an instance name of *my_FLVPlybk*, this should help you:

import mx.video.*;
var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
    trace("Elapsed play time at completion is: " + my_FLVPlybk.playheadTime);
};
my_FLVPlybk.addEventListener("complete", listenerObject);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";

Code snippet is from Flash 8 FLVPlayback.complete event documentation.

George Profenza
I'm using FLVPlayback.
Robin
I have updated my answer. Hope it helps. Goodluck!
George Profenza