A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Creating a replay button in an flv.

  1. #1
    Member
    Join Date
    Jan 2004
    Posts
    33

    Creating a replay button in an flv.

    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

  2. #2
    Bmcc*81 bmcc81's Avatar
    Join Date
    Jul 2007
    Location
    Montreal
    Posts
    299
    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,
    Last edited by bmcc81; 09-21-2007 at 12:00 PM.
    Bmcc81
    Flash Designer / Web Developer
    -----------------------------------
    http://www.webinkgraphics.com

  3. #3
    Odisey Odisey's Avatar
    Join Date
    Apr 2004
    Location
    WV
    Posts
    213

    Replay

    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
    Last edited by Odisey; 09-27-2007 at 05:54 PM.
    Much to learn.... Much to learn....

  4. #4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center