A Flash Developer Resource Site

Results 1 to 20 of 20

Thread: [RESOLVED] Play swf at the end of an FLV

  1. #1
    Senior Member caroach's Avatar
    Join Date
    Nov 2002
    Location
    Chicago, IL
    Posts
    374

    [RESOLVED] Play swf at the end of an FLV

    I've been using Flash 8's FLVPlayback component to load flv movies, but I'm wanting to use an FLV as an intro, and then continue on in the website. How can I tell Flash to gotoAndPlay("Home") after the intro FLV has completed?
    Any Help?

  2. #2
    Junior Member
    Join Date
    Jun 2006
    Posts
    25
    Event cuepoint at the end, on event load movieNum

    hope that works, please let me know.

  3. #3
    Senior Member caroach's Avatar
    Join Date
    Nov 2002
    Location
    Chicago, IL
    Posts
    374
    I've tried using a cuepoint at the end of the movie, but I can't say I'm an expert on cuePoints.
    How would I set up the 'on event load'...within the FLV or actionscript in my main movie?

  4. #4
    Senior Member caroach's Avatar
    Join Date
    Nov 2002
    Location
    Chicago, IL
    Posts
    374
    thomas - thanks for the suggestion, I finally got it working.
    Here is the code if you need the final.
    ----------------------------------------------
    post this actionscript with an FLVPlayback component labeled "Intro_Flv".
    Place an event cuePoint at the end of your FLV and use the name as the event.

    Code:
    var introListener:Object = new Object();
    introListener.cuePoint = function(eventObject:Object):Void  {
    	if (eventObject.info.name == "CUEPOINTNAME") {
    		gotoAndPlay("NEXTFRAMEorLABEL");
    	}
    };
    Intro_Flv.addEventListener("cuePoint", introListener);
    stop();
    Last edited by caroach; 07-03-2006 at 11:34 AM.

  5. #5
    Junior Member
    Join Date
    Jun 2006
    Posts
    25
    thanks man.

    the cue point is type event;
    name on the cue point: open_me
    parameters for the cuepoint: name: open_me value: open_me

    your script then on the frame that holds the FLV;

    var introListener:Object = new Object();
    introListener.cuePoint = function(eventObject:Object):Void {
    if (eventObject.info.name == "loadSquare") {
    gotoAndPlay("loadOther");
    }
    };
    open_me.addEventListener("cuePoint", introListener);
    stop();


    then it should go to a frame label : loadOther
    ?
    Last edited by thomasjojo; 08-11-2006 at 07:38 PM.

  6. #6
    Junior Member
    Join Date
    Jun 2006
    Posts
    25
    that gotoandPlay / stop on the timeline works.

    I investigating how to LoadMovie, but I would like to

    this.attachMovieClip ( or something..

    I do have movies that I have to make Cuepoints on, Events, then load/unload a text on the events.



    later man.
    Last edited by thomasjojo; 07-03-2006 at 04:51 PM.

  7. #7
    Senior Member caroach's Avatar
    Join Date
    Nov 2002
    Location
    Chicago, IL
    Posts
    374
    Your code for the first reply would be:

    the cue point type: event
    name on the cue point: end
    name of FLVPlayback: open_me
    parameters for the cuepoint: name: open_me value: open_me - don't worry about parameters

    your script then on the frame that holds the FLV;

    Code:
    var introListener:Object = new Object();
    introListener.cuePoint = function(eventObject:Object):Void {
         if (eventObject.info.name == "end") {
              gotoAndPlay("loadOther");
         }
    };
    open_me.addEventListener("cuePoint", introListener);
    stop();
    Once it reaches cuepoint "end" it should go to the frame labeled "loadOther"

    If you want it to load a movieClip, put your script in the "loadOther" frame and have it load there. If you did it in the same frame as your FLV, you would first have to unload the FLV - then attach your movieClip.

  8. #8
    Junior Member
    Join Date
    Jun 2006
    Posts
    25
    yes, I testet this and have a solution:

    - one Layer with the movie.
    - one layer with keyframes, for my text(whatever) movieclips saying:
    this.attachMovie("textclip_linkagename","textclip_ name",3,{_x:505, _y:215});
    - and of course on the frame 1 of the video (FLV), all the script for all my cuepoints


  9. #9
    Junior Member
    Join Date
    Feb 2003
    Posts
    5
    can you send me the flash file with the flv files so i can see this in flash?? thanks, I am having problems and need to fumble a little with the fla

  10. #10
    Senior Member caroach's Avatar
    Join Date
    Nov 2002
    Location
    Chicago, IL
    Posts
    374
    Sopiaz,
    So, this is assuming you're using Flash 8 professional (which has the FLVPlayback component). I'm providing you with the FLV, FLA, and Quicktime. The FLV has already been encoded with cuePoints, but you can use the QT if you want to configure the FLV. If you already know this, skip the description:

    In flash, go to "Import to Library" and choose your QT ("Test"), and click Import. A wizard will walk you through converting this to an FLV. Choose progressive download, then in the Encoding window choose the advanced options and open the Cue Points tab. In the preview box, take the playhead to the end of the movie. Click on the + sign to add a cue point. Name it "End" and set the type as "event". On the next window, because a skin probably isn't neccessary, choose "none". And Finish. The FLVPlayback should be on the stage, name it "myFLV".

    You can look at the FLV and disect the actionscript. It's not too difficult. I've just set up an event listener to listen for the "End" cue point in our FLV.
    Hopefully this helps.
    Attached Files Attached Files

  11. #11
    Junior Member
    Join Date
    Feb 2003
    Posts
    5

    Question

    I am pretty good with working with video in flash, so the import is no problem.

    thanks i will give it a shot!
    Last edited by sopiaz57; 07-11-2006 at 09:30 PM. Reason: fiixed it

  12. #12
    Junior Member
    Join Date
    Jun 2006
    Posts
    25

    now it dont work

    solved
    Last edited by thomasjojo; 08-11-2006 at 07:52 PM.

  13. #13
    Junior Member
    Join Date
    Jun 2006
    Posts
    25

    because of parameters

    solved
    Last edited by thomasjojo; 08-11-2006 at 07:52 PM. Reason: solved

  14. #14
    Junior Member
    Join Date
    Jun 2006
    Posts
    25
    not the parameters..

    stupid me.. it was the instance name of the video holder..

    this laste line:
    myFlv.addEventListener("cuePoint", flvListener);


    myFlv is the name of the instace name of the video, then its al sweet
    Last edited by thomasjojo; 08-11-2006 at 07:51 PM.

  15. #15
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    Hey guys I know you guys are prob done with this, but i have a question.

    I'm using Flash CS3 with AS3, and using .swf to stream .flv

    Here is want i would like to do:


    I have some video clips that i am playing in a .swf (MAIN.swf)(i am doing this via streaming .flv) and its working fine. What i would like to is have a shorter video (SMALL.swf)(which will also be a .swf via .flv) play before the MAIN.swf, and i want to rotate or change the SMALL.swf every 3 times the SMALL.swf gets played and keep the MAIN.swf constant. With a cycle of about 3 diffrent SMALL.swf's going down a list SMALL1.swf, SMALL2.swf, etc. I would, if it is an all-in-one .swf, to have a preloader. Kinda like this:

    Page loads...
    Preload....
    SMALL1.swf...plays....MAIN.swf.....done.

    Page loads...
    Preload....
    SMALL1.swf...plays....MAIN.swf.....done.

    Page loads...
    Preload....
    SMALL1.swf...plays....MAIN.swf.....done.

    Page loads...
    Preload....
    SMALL2.swf...plays....MAIN.swf.....done.

    Page loads...
    Preload....
    SMALL2.swf...plays....MAIN.swf.....done.

    Page loads...
    Preload....
    SMALL2.swf...plays....MAIN.swf.....done.

    Page loads...
    Preload....
    SMALL3.swf...plays....MAIN.swf.....done.

    etc.....

    I'm pretty sure you have to store a varible somewhere, somehow to keep up with the loads.

    I'm not sure where to begin with this, Im not the best at AS...so any code you can give me would be awesome. Thanks
    Sorry....I can't spell to save my life...Enjoy

  16. #16
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    Would there be anything specail you would have to do if you wanted to play another .flv after the first one?
    Sorry....I can't spell to save my life...Enjoy

  17. #17
    Junior Member
    Join Date
    Jan 2008
    Posts
    1
    Hi how would I get this to work in AS3???

  18. #18
    Junior Member
    Join Date
    Aug 2001
    Posts
    29
    Quote Originally Posted by caroach
    Sopiaz,
    So, this is assuming you're using Flash 8 professional (which has the FLVPlayback component). I'm providing you with the FLV, FLA, and Quicktime. The FLV has already been encoded with cuePoints, but you can use the QT if you want to configure the FLV. If you already know this, skip the description:

    In flash, go to "Import to Library" and choose your QT ("Test"), and click Import. A wizard will walk you through converting this to an FLV. Choose progressive download, then in the Encoding window choose the advanced options and open the Cue Points tab. In the preview box, take the playhead to the end of the movie. Click on the + sign to add a cue point. Name it "End" and set the type as "event". On the next window, because a skin probably isn't neccessary, choose "none". And Finish. The FLVPlayback should be on the stage, name it "myFLV".

    You can look at the FLV and disect the actionscript. It's not too difficult. I've just set up an event listener to listen for the "End" cue point in our FLV.
    Hopefully this helps.
    Thanks for your zip... that worked fine.
    How can this be made with Actionscript 3?
    I have a flv player that requires AS3

    Thanks

  19. #19
    Senior Member caroach's Avatar
    Join Date
    Nov 2002
    Location
    Chicago, IL
    Posts
    374

    How to make this work in AS3

    And without using cuePoints!
    There may be better ways of doing this, but this is what I find works:
    Everything is nearly identical to the AS2 version in the 'test.zip', but update the code and update the components(FLVPlayback and Button) to be compatible to AS3.

    Frame 1 code:
    PHP Code:
    function gotoFrame(event:MouseEvent):void {
        
    gotoAndPlay(2);
    }
    play_btn.addEventListener(MouseEvent.CLICKgotoFrame);
    stop(); 
    Frame 2 code:
    PHP Code:
    import fl.video.*;
    function 
    flvComplete(event:VideoEvent):void {
        
    gotoAndStop(3);
    }
    myFLV.addEventListener(VideoEvent.COMPLETEflvComplete);
    stop(); 
    Frame 3 code is just a stop();
    Try it and see if it works...let me know how it goes.
    Enjoy!
    Last edited by caroach; 03-27-2008 at 03:31 PM.
    moo

  20. #20
    Senior Member
    Join Date
    Apr 2008
    Location
    Nottingham, UK
    Posts
    348

    More cuepoint issues...

    well i'm afraid i'm going to burden you guys with more cue point "nonsense"....

    I have a series of videos which i'd like to have some control over. They're for use at a conference. Essentially (and in pseudocode, i'm afraid) in need something like this:

    videoInstance.addEventListener(Event.cuepointReach ed, doAction);

    function doAction(evt:Event):void{
    videoInstance.pause();
    addEventListener(MouseEvent.CLICK, playNow);
    }

    function playNow(evt:MouseEvent):void{
    videoInstance.Play;
    }

    the trouble is i have no idea what the proper event to listen for is. The videos are not dynamically loaded - they're in movieClips.

    Any ideas??

    Sorry for the poor grammar etc, i'm frazzled...

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