Skip to main content
jenijoss
Participant
April 6, 2009
Question

show static image then play 2 .flv

  • April 6, 2009
  • 3 replies
  • 1906 views

I want to have a player that shows a static image to begin with and then plays 2 short .flv files, one after the other and then reverts to the static image.

I've found this, which works beautifully for the static image and one movie clip but I don't know how to add the second movie clip.

startBtn.onRelease = function() {
// make sure your video has an instance name of vid
// and it is NOT set to auto play.
vid.play();
this._alpha = 0;
};
var listenerObject:Object = new Object();
listenerObject.stopped = function(eventObject) {
startBtn._alpha = 100;
};
vid.addEventListener("stopped",listenerObject);

listenerObject.playing = function(eventObject){
startBtn._alpha = 0;
//Or you can use startBtn._visible = false
}

vid.addEventListener("playing",listenerObject);

Any help would be very welcome!

Jeni

This topic has been closed for replies.

3 replies

June 22, 2009

Apologies, should have started a new discussion.

Message was edited by: FStoutamire

kglad
Community Expert
Community Expert
April 6, 2009

vid.addEventListener("complete",listenerObject);

listenerObject.complete = function(eo:Object){

if(!numCompleted){

numCompleted=1;

vid.contentPath="secondflv.flv";

vid.play();

}

}

jenijoss
jenijossAuthor
Participant
April 6, 2009

oh, that's a beautiful thing - thankyou.

What can I put at the bottom of all of that so the player rewinds to the start of the first movie. At the moment, when I hit the play button after the second movie has played, it just replays the second movie.

jeni

kglad
Community Expert
Community Expert
April 6, 2009

try:

vid.addEventListener("complete",listenerObject);

listenerObject.complete = function(eo:Object){

if(!numCompleted){

numCompleted=1;

vid.contentPath="secondflv.flv";  vid.play();

} else {

vid.contentPath="firstflv.flv";

}

}

p.s.  if your problem is solved, look for some way to mark it as solved/answered.  thank you.

kglad
Community Expert
Community Expert
April 6, 2009

if vid is an flvplayback component you can listen for the complete event to play the 2nd video.  set a variable's value if you want to prevent the 2nd video from looping (and check that variable's value before starting the 2nd video).

jenijoss
jenijossAuthor
Participant
April 6, 2009

Thank you kglad for the quick response

Yes, vid is the player and I hear what you're saying but my actionscript knowledge is just about non existant so I don't know how to do what you're telling me to do!

Are you able to show me exactly what I need to paste under my existing actionscript?