Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Play button to start my flash video

Status
Not open for further replies.

leeboycymru

Programmer
Jan 23, 2007
185
GB
I have created a flash video with a video controller, and the video does not play automatically.

But what I wanted to do was to create a button that displayed itself on the first frame, and then on click it started the video and made itself dissapear.

I know how to make it dissapear on click that isnt the problem really, but how to get the video to start and all is my main problem.

Cheers

Lee
 
Thats great, thank you that worked fine.

I was wondering if you can help me further.

When i click the button i made it plays the video and dissapears using the code below:

on (release) {
VideoScreen.play();
PlayButton._visible=false;
}

and then this piece of code waits until the video ends:

var myListener = new Object();
myListener.complete = function(eventObject) {
PlayButton._visible=true;
};
VideoScreen.addEventListener("complete", myListener);

So what happens now is that when i click the play button on the controls the button doesnt dissapear, and when i click stop so that the video goes back to the start the button doesnt re-appear.

Can you help me out a bit here

lee
 
Do not use "on(release)", do it from the main timeline:
Code:
PlayButton.onRelease = function() {
	VideoScreen.play();
	this._visible = false;
};
var myListener = new Object();
myListener.complete = function(eventObject) {
	PlayButton._visible = true;
};
VideoScreen.addEventListener("complete", myListener);

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top