A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: Dynamic video problem

  1. #1
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304

    Dynamic video problem

    I have a .flv video loading dynamically in a holder mc. Works great, but when I click on a link to another frame it continues to play..

    How do I make it stop playing when it leaves that frame?

    thanks..

  2. #2
    Flasher
    Join Date
    Jun 2005
    Posts
    1,365
    Unload the .flv. By the way, what do you mean "dynamically"?

  3. #3
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304
    sporty

    thanks for the reply.. i was in a hurry when i sent that question.. Sorry..

    I am not sure what the code would be. I have been looking for the unload action but not able to get it to work..

    thanks

  4. #4
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Are you streaming the flv into a video object using netStream?

    on(release){
    delete my_ns;
    }

  5. #5
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304
    Yes I am..

    And I have button that when pressed goes to a new frame. the movie needs to stop playing..

    i will try that code and see.. thanks..

  6. #6
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    That code will stop the movie, but it won't unload it. If your going to another frame, maybe you should delete any frames in the video object layer, so it's just not there at the other frame.

  7. #7
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304
    Ok.. that didnt work.. I put the code on the button that I use to take to the new frame..
    I am confused on where to put the code and what to use..

  8. #8
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Not sure what code your using to load the flv. In my case, my_ns is the name of the new net stream object.
    Attached Files Attached Files

  9. #9
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304
    Here is my code I am using..


    var nc:NetConnection = new NetConnection();
    nc.connect(null);

    var ns:NetStream = new NetStream(nc);

    theVideo.attachVideo(ns);

    ns.play("intromovie.flv");

    rewindButton.onRelease = function() {
    ns.seek(0);
    }
    playButton.onRelease = function() {
    ns.pause();
    }

    var videoInterval = setInterval(videoStatus,100);
    var amountLoaded:Number;

    function videoStatus() {
    amountLoaded = ns.bytesLoaded / ns.bytesTotal;
    loader.loadbar._width = amountLoaded * 222;
    }


    Thanks for helping me out..

  10. #10
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Add the delete line to the button that goes to the next frame.

  11. #11
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304
    Ok,
    I am not sure what you mean.. I am sorry just not that good at AS..

    Could you post what you mean..

  12. #12
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Yours might look like this;

    on(release){
    delete NetStream;
    _root.gotoAndPlay(2);
    }

  13. #13
    Senior Member gkbdave's Avatar
    Join Date
    Nov 2000
    Location
    Fort Bragg, NC
    Posts
    304
    Well that doesnt work either.. Error says

    Classes, interfaces, and built-in types may not be deleted.
    delete NetStream;


    any other ideas.. and I do appreciate all your help..

  14. #14
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Can you attach the fla?

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