Skip to main content
Inspiring
December 12, 2006
Question

2 flvs in a single swf

  • December 12, 2006
  • 3 replies
  • 295 views
Hi
Please help me out in insertin 2 flvs in the same swf, the first would be
and intro and the second would change randomly, I just need to know how to
put 2 flvs, when after the first stopped playing the second starts to play
than stops. Thanks


    This topic is closed to new replies. Start a new post to keep the conversation going.

    3 replies

    Inspiring
    December 13, 2006
    Thanks but it was not explicit enough for my knowledge level
    i dont know what means to play the intro explicitly
    and if in the code i should put the path of the next movie or the path of
    the intro
    would you help me please on my level? PLEASEEE thanks
    "MotionMaker" <webforumsuser@macromedia.com> wrote in message
    news:elmm99$3oe$1@forums.macromedia.com...
    > Use the FLVPlayer component.
    > Play the intro explicitly.
    > Use the complete event.
    > http://livedocs.macromedia.com/flash/8/main/00003537.html
    > The rest is some programming to select from a random list of flvs perhaps
    > stored in an array and use the contentPath propertly to load the next flv.
    >


    Participating Frequently
    December 13, 2006
    1. Play intro by setting the contentPath to that flv.
    2. When it completes use the complete event, http://livedocs.macromedia.com/flash/8/main/00003537.html
    to randomly select from an array of the other flv files and set the contentPath.

    You would need to know how to use arrays, the info in the instructions above, the Math.random function example in the online help - http://livedocs.macromedia.com/flash/8/main/00002382.html.

    Something like this although the code was not tested:

    Assumes your FlvPlayBack component is named on stage as my_FLVplybk.

    var playList:Array = new Array();
    playList.push("abc.flv");
    playList.push("xyz.flv");
    playList.push("def.flv");
    my_FLVPlybk.autoPlay = true;

    var listenerObject:Object = new Object();
    listenerObject.complete = function(eventObject:Object):Void {
    // insert event-handling code here
    my_FLVplybk.contentPath = playList[ randRange(0,playList.length-1) ];
    };
    my_FLVplybk.addEventListener("complete", listenerObject);

    function randRange(min:Number, max:Number):Number {
    var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
    return randomNum;
    }


    Participating Frequently
    December 12, 2006
    Use the FLVPlayer component.
    Play the intro explicitly.
    Use the complete event.
    http://livedocs.macromedia.com/flash/8/main/00003537.html
    The rest is some programming to select from a random list of flvs perhaps stored in an array and use the contentPath propertly to load the next flv.