5 Replies Latest reply on May 23, 2006 7:21 AM by Newsgroup_User

    How to remove a FLVPlayback Instance?

    boxdoctor
      Hi...after searching everywhere it seems as though the best way to avoid multiple problems with playing multiple FLV's in sequence is to remove the FLVPlayback instance and then reattach one. Problem is....how do you do it...ha!

      I attach it to a mc using the attachMovie method as described in the livedocs like so:

      mymainmc.attachMovie("FLVPlayback", "vPlayer", 0, {_x:-419.50, _y:-199.60, width:438.4, height:328.8});

      I get it to stop and go away by so:

      mymainmc.vPlayer.stop();
      mymainmc.vPlayer.unloadMovie();

      However I can't attach a new one since if I do a list objects debug "vPlayer" is still there. Sorry...was up late troubleshooting the other issue and I'm probably not awake yet for this easy question.

        • 1. Re: How to remove a FLVPlayback Instance?
          Level 7
          boxdoctor,

          > I get it to stop and go away by so:
          >
          > mymainmc.vPlayer.stop();
          > mymainmc.vPlayer.unloadMovie();

          If you're wrapping the FLVPlayback Component in a movie clip, you'd want
          to use mymainmc.unloadMovie(), right?


          David
          stiller (at) quip (dot) net
          Dev essays: http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: How to remove a FLVPlayback Instance?
            boxdoctor Level 1
            Hi David. Yes I do get it to go away now...but strange as this sounds...I can't use that same name for the FLVP instance again if I want the others to work. If I get rid of the vPlayer, and then try to attach it back...nothing...but I see the object does exist.

            If I autostart the FLV in vPlayer...get rid of it as you described above...and then add a new FLVP instance called vPlayer2 (note the 2 added) all the others work like a charm. It's baffling.

            Any additional thoughts?
            • 3. Re: How to remove a FLVPlayback Instance?
              Level 7
              boxdoctor,

              > If I autostart the FLV in vPlayer...get rid of it as you described
              > above...and then add a new FLVP instance called vPlayer2
              > (note the 2 added) all the others work like a charm. It's baffling.

              That part doesn't baffle me, because by giving it a different instance
              name, you're generating a new FLVPlayback instance (a new object). If
              anything, *this* should make your app run slower after a while, because you
              may have several instances, only one of which is used, after a while.

              What's the LiveDocs page you mentioned earlier, the one that shows the
              attachMovie() example?


              David
              stiller (at) quip (dot) net
              Dev essays: http://www.quip.net/blog/
              "Luck is the residue of good design."


              • 4. Re: How to remove a FLVPlayback Instance?
                boxdoctor Level 1
                Hi David. Maybe I should say that it doesn't baffle me that they all work, since I agree with you that it would make the app eventually run really slow, but rather the fact that the original playback instance vPlayer won't load a new FLV content into it...but maybe I'm asking too much of it...and indeed you need to remove the FLVplayback and create a new one which is what we're doing here. I've seen a few livedoc comments from some other flashers saying that simply changing the contentPath of the FLVPlayback instance doesn't always work.

                Anyway...in answer to your question....here is the livedocs example I was using to try and attach the FLVplayback instance and then remove it.

                http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context= LiveDocs_Parts&file=00003479.html
                • 5. Re: How to remove a FLVPlayback Instance?
                  Level 7
                  boxdoctor,

                  > Maybe I should say that it doesn't baffle me that they
                  > all work, since I agree with you that it would make the
                  > app eventually run really slow, but rather the fact that
                  > the original playback instance vPlayer won't load a
                  > new FLV content into it...

                  I'm sorry to hear you're having trouble with it. :-/ I wish, too, I
                  could offer something substantial in the way of help. In my own FLVPlayback
                  experience -- which is admittedly not vast -- I haven't encountered your
                  issue.

                  > but maybe I'm asking too much of it...and indeed you
                  > need to remove the FLVplayback and create a new
                  > one which is what we're doing here.

                  I've run a few tests with the Debugger panel, and the only FLVPlayback
                  object I see (after a MovieClip.unloadMovie() removal) is the Component
                  property in the _global object, which is where all AS classes go. Try
                  followed my Component removal with ...

                  delete _global.FLVPlayback;

                  ... and ...

                  _global.FLVPlayback

                  ... neither of which seems to do anything.

                  Have you considered this? Create a Library asset (a movie clip symbol)
                  with an FLVPlayback instance in it, and attach *that* rather than attaching
                  merely FLVPlayback. When it's time to "hit the reset button," so to speak,
                  drop the whole movie clip wrapper and re-attach as desired. It may not put
                  you any further than you are, but it's easy to try and worth the shot.


                  David
                  stiller (at) quip (dot) net
                  Dev essays: http://www.quip.net/blog/
                  "Luck is the residue of good design."