dcsimg
A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: looping an flv

  1. #1
    Senior Member
    Join Date
    Oct 2002
    Posts
    163

    looping an flv

    I made this flv movie that I use as a banner for my site but I would like it to loop... So far, it just stops when the flv movie is done playing.

    Any idea?

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Location
    London
    Posts
    361
    Can you post the FLA?
    I need to know your setup first.

  3. #3
    Senior Member
    Join Date
    Oct 2002
    Posts
    163
    Originally posted by Dene
    Can you post the FLA?
    I need to know your setup first.
    fla file

    Thanks!

  4. #4
    Senior Member
    Join Date
    Jan 2001
    Location
    London
    Posts
    361
    Hi I've tried 2 methods for looping an FLV. The first was with the Media component and the second was using my own FLV Stream Control component.

    The first method with the Media component involved the following code:
    Code:
    myListener = new Object();
    myListener.complete = function()
    {
    	waterClip.water.play(0);
    }
    waterClip.water.addEventListener("complete", myListener);
    where 'water' is your component instance within the movieclip waterClip. That code creates a listener object to listen out for the component's "complete" event.

    This works although there is a small pause before the video loops back to the start. This obviously wont do.

    I have a attached the FLA for the above and a second FLA which solves the pausing problem.

    For the loop to work seamlessly in the second component you need to create the FLV with more keyframes. So when you re export it and set the option 'Frames per Keyframe' to about 20.

    Then use the tool at www.swfx.org/flv-duration on the FLV to make it compatible with the component. To hide the control bar on the component select the parameter from the Properties panel 'Hide Controlbar'.

    See the FLA attached, waterLoop.fla

    Best,
    Dene.

  5. #5
    Senior Member
    Join Date
    Jan 2001
    Location
    London
    Posts
    361
    Hi I've tried 2 methods for looping an FLV. The first was with the Media component and the second was using my own FLV Stream Control component.

    The first method with the Media component involved the following code:
    Code:
    myListener = new Object();
    myListener.complete = function()
    {
    	waterClip.water.play(0);
    }
    waterClip.water.addEventListener("complete", myListener);
    where 'water' is your component instance within the movieclip given an instance name of 'waterClip'. That code creates a listener object to listen out for the component's "complete" event.

    This works although there is a small pause before the video loops back to the start. This obviously wont do.


    Method 2 (FLA attached):

    For the loop to work seamlessly in the second component you need to create the FLV with more keyframes. So when you re export it and set the option 'Frames per Keyframe' to about 20.

    Then use the tool at www.swfx.org/flv-duration on the FLV to make it compatible with the component. To hide the control bar on the component select the parameter from the Properties panel 'Hide Controlbar'.

    See the FLA attached, waterLoop.fla

    Best,
    Dene.

  6. #6
    Senior Member
    Join Date
    Oct 2002
    Posts
    163
    Got it! Thank you sooo much for your help and explanations on how it works... ! Saved me a lot of time and trouble! LOL
    Last edited by 3dsounds; 07-15-2004 at 06:46 PM.

  7. #7
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    I can't seem to get around the pause problem. I've tried all the way up to 100 keyframes. Is there something about the stock component that does that?

    //the .fla is too big too upload but I just have a media display component on the stage and this code on frame 1

    Code:
    myListener = new Object();
    myListener.complete = function(){
    	myMedia.play(0);
    }
    myMedia.addEventListener("complete", myListener);
    Last edited by jAQUAN; 07-29-2004 at 07:26 PM.

  8. #8
    Senior Member
    Join Date
    Jan 2001
    Location
    London
    Posts
    361
    Are you talking about the FLV pausing before it reaches the very end?
    Try importing the video into Flash and exporting it from the library as an external FLV file. That should solve it.

  9. #9
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    its more like a blank frame between the end and the beginning of the repeat. I'll try what you suggested.

  10. #10
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    hmm, didnt seem to make any difference. Could it be that the .flv is 150k? Do I have to use NetStream to get more control over it? There has got to be a fool proof way of getting seamless loops.

  11. #11
    Senior Member
    Join Date
    Jan 2001
    Location
    London
    Posts
    361
    The Macromedia Media component seems to pause for a fraction of a second at the end of the video when you try to loop it back to the start.

    My FLV player isn't prone to this problem - you could try the demo from this link. You just have to listen for the 'end' event instead of 'complete'. See the User Guide for more info.

    Dene.

  12. #12
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    well I'd wish you'd just explain it to me instead of trying to make a buck but thanks anyway.

  13. #13
    Junior Member
    Join Date
    Nov 2003
    Location
    Sydney
    Posts
    17
    Hi

    is there anyway to limit the number of loops? I need to only loop it 3 times

    ta
    chris

  14. #14
    Junior Member
    Join Date
    Oct 2007
    Posts
    2

    hi,

    hi, the flv loop is not working for me , it even copied and paste your code but it didn't loop it at all.


    i even made a movie clip instanced it waterClip and video component named water but it didn't work.


    can you help me
    thanks
    ak

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