Jump to content
Search Community

Replay button after Video is done playing

lanawylma test
Moderator Tag

Recommended Posts

Hi All,

 

I loaded a Video on Button click with Loader Max, what I would like to do, is place a replay button when the video is done playing.. but I'm not sure where to insert it.. any help would be very appreciated!! Here's the code:

 

var videoTest:VideoLoader = new VideoLoader("Breathe_Video.f4v",{container:this,

x:0, y:0});

 

function breathe_play_video(event:MouseEvent):void {

 

videoTest.load();

this.addChild(videoTest.content);

addChild(close_btn);

close_btn.x = 930;

close_btn.y = 0;

 

}

 

Thank you!

Link to comment
Share on other sites

I added:

 

var videoTest:VideoLoader = new VideoLoader("Breathe_Video.f4v",{container:this,

x:0, y:0, onComplete:completeHandler});

 

 

function completeHandler(event:LoaderEvent):void {

trace("test");

}

 

I'm getting error: 1046 Compile_time constant: LoaderEvent..

Link to comment
Share on other sites

You need to set up a VIDEO_COMPLETE event listener which will fire when the video is done playing

 

1: import the LoaderEvent

 

import com.greensock.events.LoaderEvent;

 

2: hook up an event listener to your videoTest loader

 

videoTest.addEventListener(VideoLoader.VIDEO_COMPLETE, done);

function done(e:Event):void{
trace("done");
//add code to add replay button
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...