;

PDA

Click to See Complete Forum and Search --> : Creating a replay button in an flv.


dennell
09-05-2006, 10:21 AM
Hi i know how to create a replay button... thats easy..

The problem that I have is that i want to create a replay button that will appear whe the .flv movie ends(i have created my own media player using some tutorials)... its a toughy. i really dont know how to do this one.

So just to run through what i want tto happen:

1. the page loads and plays the movie on a progressive download
2. when the movies come to the end i want a menu to appear so that the user can choose to replay the movie they just saw...

I know.... seems pretty simple. But im new.

thanks :mrt:

bmcc81
09-21-2007, 11:39 AM
Hi, Just wondering if you ever figured it out? I'm trying the same thing. I used this to get the button to show up, but I'm having trouble getting the thing to replay.

////////////////////////////////////////////////////////////////////////////////

_root.stream_ns.onStatus = function(infoObject) {

if (infoObject.code == "NetStream.Play.Stop") {
_root.SoundPlayer._visible=false;
trace(infoObject.code);
buttonInstanceName._visible = true;
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
vidTV.attachVideo(stream_ns);
stream_ns.play(_root.prefix+"videos/"+_root.currentTinVideo);
// video stopped, show the button
}
if (infoObject.code == "NetStream.Play.Start") {
_root.SoundPlayer._visible=true;
buttonInstanceName._visible = false;
trace(infoObject.code);
// video playing, hide the button
}
};

////////////////////////////////////////////////////////////////////////////////


Hope that helps you & i hope yu can aide me in finding out how to get this replay button to replay the flv.

Thanks,

Odisey
09-27-2007, 05:51 PM
I am not sure about your code strategy there. Can you make it work from this strategy.

Create a layer above the video component in the FLA. Create a key frame in the timeline at the #2 position. Here is where you put your replay button.

When the movie loads the play head encounters a stop() AS at the #1 position - you put the stop() in of course. However I think the flv should download anyway becuase it is remote and dynamic. In your code if the film is playing it just does that. If it stops - or ends streaming, then the playhead goes to the #2 position. There your button will appear. Set behaviors so when you click it you go back to the #1 position where in theory your movie will begin the stream again.

No I did not try this. Looks good on paper.

ODC

a_modified_dog
09-28-2007, 06:06 PM
simple example -

http://www.jackleaman.co.uk/test/flv/netConnection_replay_button.html