seek(0) after the flv finished playing
I have finally successfully made my movie respond to start pause function (I only have one button in player and want it to stay like this)
My problem is as follows.
When the movie reaches the end of the clip it stops but the icon stays on play mode (pause icon showing).
I want my movie to seek back to the beginning and the play icon to show up again in case the user wants to replay the film. I don't want to loop it automatically...
I have tried with creating an event listener but to no success.
I have tried to use ns.onstatus and I also couldn't get the results i wanted.
I am very very very new to that.... so I might have types something wrong in there.
I have enclosed my code for review.
Any help will be appreciated.
NOTE: this answer uses ActionScript 3. NOT AS2
I know of a few ways to simply accomplish this. perhaps the more expert people can also tell you other ways too. I try to go for complete simplicity, and the most direct logic, too.
The first way would be to embed CUEPOINTS in your video. I would put a navigation style CuePoint at the very beginning, and an Event CuePoint at the very end. once the video plays, and it reaches the end CuePoint it can trigger any function you want, such as telling it it to gotoAnd Seek the beginning ( by the navigation Cue Point) as well as tell your Play/Pause button to be in whatever state you want. I have discussed and given code for Cue Points in other posts. If you want to go that route, look for those posts, try it, and write back if you need help.
Another way relies on the VideoEvent Class, so you need to import that class.
i posted a little, bare-bones example of this at
there is a FLVPlayback component on the stage, instance name "flvPlayer"
i created 2 MovieClips to act as buttons, They will be added at run-time, with Linkage names of "pplay" and "ppause" it is actually easier for me in this instance to use 2 separate MovieClips to simulate a single button and its states.
this is what the code does:
1) imports the VideoEvent class
2) tells the Player the source ( in this case 'george2.flv')
3) tells the player NOT to autoplay,
4) adds the Play button to the stage
When the Play button is CLICKED, it swaps out the play button for the pause button, and it also causes the video to play.
When the Pause button is CLICKED, it swaps out the pause button for the Play button, and it stops the video playhead.
the video player listens for the end of the video (COMPLETE), and swaps out the Pause button for the Play button, which once clicked, will start the video from the beginning.
here is the code i wrote for this example. you should be able to adopt it to your needs:
let us know how you make out - and post your link(s)