AS3
Dynamic Flash Video Playlist with Poster Movie for AS3
Recently I had the need to create a Flash video playlist in AS3 and needed a poster movie for the beginning of the playlist. I found a great tutorial on for a playlist Web Video Template: Dynamic video playlist by Lisa Larson-Kelley. This tutorial provided everything I needed to make my playlist with the exception of the poster movie.
I found that by combining a couple of other methods I got the effect I was looking for.
After I got the playlist working as shown by Lisa, I then found this tutorial for creating a Flash poster movie Adding a Poster Frame to Flash Video that helped to push me in the right direction. I didn’t use the whole thing but rather a portion that helped me to add a listener for when the play button is pushed.
I added the following line to the initMediaPlayer function within the VideoPlaylist.as and after the myVid.pause() line.
-
myVid.addEventListener(VideoEvent.PLAYING_STATE_ENTERED, hidePosterFrame);
Then I created a function called hidePosterFrame
-
function hidePosterFrame(event:Event):void{
-
mcHead.alpha = 0;
-
TransitionManager.start(mcHead, {type:Fade, direction:Transition.OUT, duration:2, easing:Strong.easeOut});
-
}
Voila! A poster movie for the dynamic playlist.