4 Replies Latest reply on Mar 13, 2008 1:13 PM by Newsgroup_User

    MIAW still playing in the background

    HairRaiser
      MIAW is still playing in the background even after closing the window. How can I totally turn it off?
        • 2. Re: MIAW still playing in the background
          Level 7
          There are many ways and they might all be covered in Sean's reference. If
          you don't need or want to remove it from member (aka forget ()) then you can
          also add some code that will pause the movie whenever it closes. That also
          can be done several ways but most easily initiated from the "on CloseWindow"
          handler.


          "HairRaiser" <webforumsuser@macromedia.com> wrote in message
          news:fqt234$888$1@forums.macromedia.com...
          > MIAW is still playing in the background even after closing the window. How
          > can I totally turn it off?


          • 3. Re: MIAW still playing in the background
            HairRaiser Level 1
            Hello,
            I'm using MX2004 and my MIAW script looks like this:

            on openWindow
            window().new ("windowName")
            window("windowName").fileName = "folder\fileName"
            preLoadMovie "folder\fileName"
            end

            on mouseDown me
            window().new("folder\fileName").open()
            end


            ...and this is how I try to close it:

            on closeWindow
            window("windowName").close()
            end

            on mouseDown me
            window("windowName").forget()
            end


            Now my problem is... the .forget() is not working. Window is still open (playing) in the background. Can anyone please tell me what went wrong?
            • 4. Re: MIAW still playing in the background
              Level 7
              Your post is a little unclear. Are the openWindow() and closeWindow()
              handlers in #movie scripts? They won't be called otherwise.

              I would change your first mouseDown handler to:
              on mouseUp me
              w = window().new ("windowName")
              w.fileName = "@/folder/fileName"
              w.open()
              end

              That should cleanly take care of opening your MIAW.


              There are a couple of reasons that forget() might not be seeming to work.
              Firstly: it's never being called. You can test this by adding an alert
              to your second mouseDown handler like so:
              on mouseUp me
              alert "Forgetting window"
              window("windowName").forget()
              end

              The other reason a MIAW may not disappear even when you forget() it is
              because you have a variable somewhere that holds a reference to the
              window. Commonly this is because you store a reference to the MIAW in a
              global. If you do, you must VOID the global when you forget the window,
              otherwise it will persist. All the forget() command does it remove the
              reference from the windowList - assuming there are no more refs the
              window will disappear.