dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Auto-rewind and Play/Pause Button Swapping

  1. #1
    Junior Member
    Join Date
    Aug 2005
    Posts
    17

    Auto-rewind and Play/Pause Button Swapping (newbie)

    I'm looking for:

    1 - some actionscript that will automatically jump a streaming .flv video back to its first frame after it has played

    and

    2 - a method whereby I can swap out images for play and pause when the user clicks the play button

    thanks eversomuch!
    Last edited by norphin; 10-31-2005 at 03:07 PM.

  2. #2
    Member
    Join Date
    Sep 2005
    Posts
    58
    Norphin,

    Check out http://www.gotoandlearn.com. He has tutorials for both of what you are asking. Watch the mute/unmute tutorial for your pause/play toggle.

    Bolt
    My Flash Video Blog
    Get Flix Pro here (My starving college sister's affiliate link)

  3. #3
    Junior Member
    Join Date
    Aug 2005
    Posts
    17
    Thanks. I've actually been through a bunch of those tutorials already. One of the tutes does show how to auto-rewind when a video has finished playing. I then added an "ns.pause" line to prevent the clip from looping. I couldn't find any reference to swapping button visibility, but I might've just missed it. (Video tutorials are great for learning but not so great for referencing.)

    However, I think I've figured it all out. Perhaps the code below will help someone else. If anyone has more elegant solutions, cool.

    Here's the code I'm using to auto-rewind and pause after a streamed .flv has played:

    PHP Code:
    if(info.code == "NetStream.Play.Stop") {
            
    ns.seek(0);
            
    ns.pause();
        } 
    And here's the code I'm using to swap the play and pause buttons (which are stacked one atop the other on the stage):
    PHP Code:
    pauseButton.onRelease = function() {
        
    ns.pause();
        
    setProperty("_root.pauseButton"_visiblefalse);
        
    setProperty("_root.playButton"_visibletrue);

    }

    playButton.onRelease = function() {
        
    ns.pause();
        
    setProperty("_root.playButton"_visiblefalse);
        
    setProperty("_root.pauseButton"_visibletrue);


    Last edited by norphin; 11-01-2005 at 08:35 PM.

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