| View previous topic :: View next topic |
| Author |
Message |
jsrobinson AFC Member
Joined: 12 Sep 2007 Posts: 4
|
Posted: Wed Sep 12, 2007 9:05 pm Post subject: Switching FLV via javascript? |
|
|
I read this post:
http://www.afcomponents.com/forum/viewtopic.php?t=1426
If I add this code to the player, how do I then send the FLV player a new FLV file to play via javascript?
Also, can I drop the following code
| Code: | function playerCompleteHandler(evnt:Object) {
// go to the next scene
}
myPlayer.addEventListener("complete", playerCompleteHandler); |
into the same area as the other functions in the flv_player_embed.fla?
Flash Newbie here, but love the player (especially the embedded version with the FlashParams!) and it's teaching me a lot about Flash in the process
Thank you!  |
|
| Back to top |
|
 |
andreit AFC Team

Joined: 20 Aug 2005 Posts: 2016
|
Posted: Fri Sep 14, 2007 6:15 am Post subject: Playing new movie at the end |
|
|
From what I gather you would like to load the second video right after the first finishes playing. In the embeddable FLV Player example we pass all of our date through FlashVars. What you need to do is pass an additional FLV File.
| Code: | | <param name="FlashVars" value="..........&newMovie=file.flv" /> |
From now on the newMovie variable will be available inside flash and you can reference it inside the playerCompleteHandler function.
| Code: | function playerCompleteHandler(evnt:Object) {
evnt.target.content = {path:newMovie}
}
myPlayer.addEventListener("complete", playerCompleteHandler); |
|
|
| Back to top |
|
 |
jsrobinson AFC Member
Joined: 12 Sep 2007 Posts: 4
|
Posted: Sat Sep 15, 2007 8:59 pm Post subject: Getting close... |
|
|
This gets me most of where I need to be.
I set the autoplay to true, and it works, but the play button is showing up.
Why isn't this working?
| Code: | //-------------------------------------------------
// Get Next Video To Play after Intro
//-------------------------------------------------
function playerCompleteHandler(evnt:Object) {
myPlayer.autoPlay = true;
evnt.target.content = {path:newMovie};
hidePlayButton();
}
myPlayer.addEventListener("complete", playerCompleteHandler); |
Thank you for the great support! |
|
| Back to top |
|
 |
jsrobinson AFC Member
Joined: 12 Sep 2007 Posts: 4
|
Posted: Sat Sep 15, 2007 9:01 pm Post subject: more... |
|
|
is there a way to have HTML/Javascript on the page tell the player what FLV to play?
I can load the intro, then play the followup clip, but once that is done, I would like to allow the user to select a different FLV from a list to play. The playlist is HTML (if you couldn't guess already). |
|
| Back to top |
|
 |
jsrobinson AFC Member
Joined: 12 Sep 2007 Posts: 4
|
Posted: Sat Sep 15, 2007 10:48 pm Post subject: trying to answer my own questions... |
|
|
I can get the play button to go away, but it seems to take a couple of seconds after the 2nd video has started to play. Here is the AS code:
| Code: | function playerCompleteHandler(evnt:Object) {
evnt.target.content = {path:newMovie};
evnt.target.play();
}
myPlayer.addEventListener("complete", playerCompleteHandler); |
the evnt.target.play() triggers the hidePlayButton function, but as I said, this takes place well after the movie starts playing. The playing of the first movie does not exhibit this behavior.
any ideas?
Thanks! |
|
| Back to top |
|
 |
wigz AFC Team

Joined: 27 Mar 2007 Posts: 570
|
Posted: Tue Sep 18, 2007 6:28 pm Post subject: |
|
|
jsrobinson,
The player enters the buffering state before it plays, so maybe you could attach your hidePlayButton to the "buffering" event. Thanks!
~Wigz |
|
| Back to top |
|
 |
barcajunior AFC Member
Joined: 11 Jan 2008 Posts: 1
|
Posted: Fri Jan 11, 2008 4:28 pm Post subject: |
|
|
| Quote: | //-------------------------------------------------
// Get Next Video To Play after Intro
//-------------------------------------------------
function playerCompleteHandler(evnt:Object) {
myPlayer.autoPlay = true;
evnt.target.content = {path:newMovie};
hidePlayButton();
}
myPlayer.addEventListener("complete", playerCompleteHandler); |
The code is very useful.
473nm DPSS Lasers |
|
| Back to top |
|
 |
|