A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Unloading/Clearing an external .flv

  1. #1
    Junior Member
    Join Date
    Aug 2001
    Posts
    17

    Unloading/Clearing an external .flv

    I am using this code on the main timeline to load an external flv:

    Code:
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    videoPlayer.attachVideo(ns);
    ns.setBufferTime(5);
    then a button (inside a Movie Clip ) triggers the load like this:

    Code:
    on (press) {
    _root.ns.play(”office.flv”);
    }
    This works great for loading the flv. However I want a button that removes the flv when clicked. I have a Movie Clip (with a button inside called close_btn ) on the main timeline with this action on the MC timeline:

    Code:
    close_btn.onRelease = function(){
    _root.ns.close();
    };
    This only freezes the video in place and does not remove it from the stage. Anybody know what I can do to get it off there completely? _root.ns.clear() doesn't work either...

  2. #2
    Junior Member
    Join Date
    Aug 2001
    Posts
    17

    solution

    this extra line gets rid of the .fla:

    close_btn.onRelease = function(){
    _root.ns.close();
    _root.videoPlayer._visible = false;
    _root.videocover.gotoAndStop('invis');
    };

    However, now there is a new problem. Once I remove the .fla witht he button, I can't get it to reload. is there a way to reset the stream or whatever so that it can play again?

  3. #3
    Junior Member
    Join Date
    Aug 2001
    Posts
    17
    duh, all I had to do was reset the visibility to true when you clicked one of the button that load the .flv like so:

    _root.videoPlayer._visible = true;

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