dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: After FLV Plays, Go back to beginning of movie?

  1. #1
    Junior Member
    Join Date
    Feb 2005
    Posts
    9

    After FLV Plays, Go back to beginning of movie?

    I have a simple file that I'm trying to add fuctionality to -- it is basically a button that uses this code to play a video:

    Code:
    button.onRelease = function() {
        this._visible = false;
        trace("clicked "+this._name);
    };
    So, that works great. You click a button, the video plays. My question is, once the FLV is done, how do I get the flash file to go back to the beginning and once again show the Button, and rewind the video? As it stands right now, it just sits on the last frame of the .flv.

    THANKS!

  2. #2
    Junior Member
    Join Date
    Feb 2005
    Posts
    9
    I've been trying to figure this out, and so far I've got this far:

    Code:
    var listenerObject:Object = new Object();
    listenerObject.complete = function(eventObject:Object):Void {
    // what do I put here
    };
    myVideo.addEventListener("complete", listenerObject);
    So what I need to know is this: What do I put in the "what do I put here" section that will basically restart the .swf from the very start ... where the button showed up (see my previous post).

    Help?

  3. #3
    Senior Member layerburn's Avatar
    Join Date
    Jul 2006
    Location
    USA
    Posts
    542
    If you want the video to loop you would put

    myVideo.play();

    If you wanted it to go back to the first frame of the flv

    myVideo.rewind();
    This is your brain. This is your brain on script.

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