3 Replies Latest reply on Mar 4, 2010 4:56 PM by aryenb

    Miaw Director 11.5

    aryenb

      When I updated my project to from Director MX (Mac) to Director 11.5 (PC) i got a script error when opening a miaw.

      I used the following script:

       

      ------------------------------------------------------------------------------------------ --------------------------------------------

      IN MAIN MOVIE:

      -------------------------------------
      --a basic handler to open the MIAW
      -------------------------------------

      global gDemoWin
      on mouseUp
        set gDemoWin to window "" --assigns gDemoWin to a window named"win1"
        set the fileName of gDemoWin to "@:extern:miaw" --set gDemoWin's file name to the actual .dir file
        set the windowType of gDemoWin to 4 --sets the type of window the MIAW will be dispalyed at
        open gDemoWin --opens the window
      end

       

      -------------------------------------
      --a basic handler to close the MIAW
      -------------------------------------
      global gDemoWin
      on mouseUp
        if gDemoWin=0 then --checks if the MIAW is open, if it's not open an ALERT will be shown.
        else
          close gDemoWin --closes the window assigned to gDemoWin
          forget gDemoWin --instructs Lingo to close and delete the window assigned to gDemoWin
        end if
      end

       

      -------------------------------------------

      IN MIAW:

      -------------------------------------
      --a basic handler to close the MIAW
      -------------------------------------
      global myMIAW

      on mouseUp
        if myMIAW = 0 then --checks if the MIAW is open, if it's not open an ALERT will be shown
          alert "no MIAW is present" --ALERT is executed
            else
          myMIAW.forget() --instructs Lingo to close and delete the window assigned to myMIAW
            end if
        end

       

      on enterFrame
        if myMIAW = 0 then --checks if the MIAW is open, if it's not open an ALERT will be shown.
          alert "no MIAW is present"--ALERT is executed
            else
          myMIAW.forget() --instructs Lingo to close and delete the window assigned to myMIAW
            end if
        end

       

       

      Does anyone knows how to get the same result in Director 11.5?

       

      With kind regards,

      [name removed by request of poster]

        • 1. Re: Miaw Director 11.5
          Chunick Level 3

          try the newer MX2004+ window syntax. Check the online help docs for the Window Object... not at my Director dev PC so cannot post exact syntax right now.

          1 person found this helpful
          • 2. Re: Miaw Director 11.5
            Sean_Wilson Adobe Community Professional

            See if the following helps to get you started:

            -------------------------------------
            --a basic handler to open the MIAW
            -------------------------------------
            
            global gDemoWin
            on mouseUp
              gDemoWin = window().new( "win1" ) --assigns gDemoWin to a window named"win1"
              gDemoWin.fileName = "@:extern:miaw" --set gDemoWin's file name to the actual .dir file
              gDemoWin.type = #tool --sets the type of window the MIAW will be dispalyed at
              gDemoWin.open() --opens the window
            end
            
            
            
            -------------------------------------
            --a basic handler to close the MIAW
            -------------------------------------
            global gDemoWin
            on mouseUp
              if _player.windowPresent(gDemoWin) then --checks if the MIAW is open, if it's not open an ALERT will be shown.
                gDemoWin.close() --closes the window assigned to gDemoWin
                gDemoWin.forget() --instructs Lingo to close and delete the window assigned to gDemoWin
              else
                alert "no MIAW is present" --ALERT is executed
              end if
            end
            
            • 3. Re: Miaw Director 11.5
              aryenb Level 1

              Hi Sean,

               

              Thanks for your answer, it works well, I only had to change (gDemoWin) in ("win1") to close the miaw.

               

              -------------------------------------
              --a basic handler to close the MIAW
              -------------------------------------
              global gDemoWin
              on mouseUp
                if _player.windowPresent( "win1" ) then --checks if the MIAW is open, if it's not open an ALERT will be shown.
                  gDemoWin.close() --closes the window assigned to gDemoWin
                  gDemoWin.forget() --instructs Lingo to close and delete the window assigned to gDemoWin
                else
                  alert "no MIAW is present" --ALERT is executed
                end if
              end