A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: create an automatic action after flv finished

  1. #1
    Member
    Join Date
    Jul 2002
    Posts
    39

    create an automatic action after flv finished

    hello,

    I am using MX2004 pro and I am loading .flv dynamically using the media component.

    I would like once one flv file as been finishing of playing to go to a next frame or another scene Automatically. how can i do that?

    Thanks

    Xav

  2. #2
    Junior Member
    Join Date
    May 2000
    Posts
    6

    I Need This Too

    I am working on the same thing! and I can't figure it out either. When working with slides, you don't really have a timeline.

    I don't know where to put the code and exactly what would be the best code to put.

  3. #3
    Member
    Join Date
    Jul 2002
    Posts
    39
    Hi,

    I have managed to do that by having listener on the first frame of my scene, once it finishes I have a button that turns up and let me go to the next flv.

    soem code from ultrashock i have used and good tutorial.

    http://www.ultrashock.com/ff.htm?htt...2004/video.php

    kcabe

  4. #4
    Member
    Join Date
    Aug 2004
    Posts
    32
    Hi,

    You obviously posted this almost a year ago, im hoping you may still remeber how you did what you say in the post. I am trying to automatically navigate to a labelled frame after a FLV has finshed.

    Im a bit of a newbie when it comes to actionscript and cant really fully understand the tutorial your link goes to.. I'm hoping you might take pity on my patheticness as i have an impossible deadline to meet, and share a little code required to do this...

    Cheers

    not so.....Jolly Chap

  5. #5
    Member
    Join Date
    Jul 2002
    Posts
    39
    Hello

    I posted that code into my frame where the video is playing

    part 1 it attach the .flv to en embeded video with:
    video1d.attachVideo(my_ns);
    my_ns.play("video1d.flv");

    part 2 it goes to another frame:
    there is also a button on the same frame that appears to (replay_btn)

    waitingForEmpty=false;
    replay_btn._visible=false;
    replay_btn.onPress=function(){
    replay_btn._visible=false;
    waitingForEmpty=false;
    //my_ns.play("marg1.flv");
    _root.gotoAndPlay("t2a");

    hope that helps

    Source code i took it from the tutorial mentioned in the post

    my_nc = new NetConnection();
    my_nc.connect(null);
    my_ns = new NetStream(my_nc);
    video1d.attachVideo(my_ns);
    my_ns.play("video1d.flv");

    my_ns.onStatus = function(info) {
    for (var i in info){
    trace(i+" = "+info[i]);
    }
    if(info.code=="NetStream.Buffer.Empty" && waitingForEmpty==true){
    //display a play button because the video is done
    replay_btn._visible=true;
    }
    if(info.code=="NetStream.Play.Stop"){
    waitingForEmpty=true;
    }

    };

    waitingForEmpty=false;
    replay_btn._visible=false;
    replay_btn.onPress=function(){
    replay_btn._visible=false;
    waitingForEmpty=false;
    //my_ns.play("marg1.flv");
    _root.gotoAndPlay("t2a");
    }
    stop();

  6. #6
    Member
    Join Date
    Aug 2004
    Posts
    32
    Boy im thick... i guess im just not getting it...

    im using a FLV player component..

    at the moment I have in my first frame:

    stop();
    myPlayer.loadVideo("flvduration/vid.flv");

    all I want is for the movie to jump to a labelled frame... ie

    _level0.gotoAndPlay("vid_links");

    not needing a button..

    I tried using some of the code you suggested but I'm sure exactly what code is required... dont laugh to hard but this was what I was trying to use:

    stop();
    myPlayer.loadVideo("flvduration/vid.flv");
    waitingForEmpty=false;
    _level0.gotoAndPlay("vid_links");

    it does fire me to the correct frame but immediatley and not after the videos played...

    im not understanding the key element of how to get flash to recognise the movie finishing..

    Sorry but any help is well apreciated

    slighty..jollier chap

  7. #7
    Member
    Join Date
    Jul 2002
    Posts
    39
    i didnt use a flv player, i use an embedded video component it should work if u get ride of the button it should go the frame you specify.

    xav

    Ps: i am not a very cody person neiher

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