5 Replies Latest reply on Feb 25, 2007 8:04 AM by Newsgroup_User

    trouble with MIAW

    the_Shelest
      hi..
      I have a stage and 2 MIAW, calling from there.. every MIAW have button "Exit" with code:

      tell the stage to window("kuda").forget()

      1 or 2 times it's work.. MIAW closing normally.. but after that if I open MIAW again and trying to close it.. I have fatal error..

      I can not use window("kuda").close() becose in a MIAW working SWF scene with audio and after MIAW closing a window dissappear but audio stay playing

      please help..

      sorry for my english :)..
        • 1. Re: trouble with MIAW
          Level 7
          It depends I think on the version of Director you, but I know in older
          versions(8.5?) you do it that way. You have to send a merssage to a custom
          handler in the main movie that has the forget command in it, otherwise you
          will see those errors.


          • 2. Re: trouble with MIAW
            Level 7
            Your problem is that you can't issue a #forget command from within the
            context of the window being forgotten.

            Try the following script on your close button/s:
            --
            on mouseUp me
            t = script("window.closer.class").new(_player.activeWindow)
            end

            and include the following as a *parent* script named
            "window.closer.class" in a castLib accessible by the the MIAW/s:
            -- parent script "window.closer.class"
            property pWindow

            on new me, aWindow
            pWindow = aWindow
            pWindow.forget()
            t = _player.window["stage"].movie.timeOut().new(string(me), 0,
            #dummy, me)
            end

            on exitFrame me, aTimeout
            aTimeout.forget()
            end

            on prepareFrame me, aTimeout
            aTimeout.forget()
            end
            • 3. Re: trouble with MIAW
              Level 7
              >>Your problem is that you can't issue a #forget command from within the
              context of the window being forgotten.

              You can in MX2004 without issue. In prior versions though, you're right.

              --
              Dave -
              Head Developer
              www.blurredistinction.com
              Adobe Community Expert
              http://www.adobe.com/communities/experts/


              • 4. Re: trouble with MIAW
                Level 7
                > You can in MX2004 without issue.

                Hi Dave - are you saying this from experience, or is there a TN or
                release note to this effect?
                • 5. Re: trouble with MIAW
                  Level 7
                  Yeah, I still have problems even with MX04 when attempting to close
                  MIAWs from within themselves. It errors less, but it still causes
                  problems. I think they fixed it in 1 or 2 places, but not everywhere.
                  I always have better luck doing it the oldskool way by sending the stage
                  a message which closes the window.