3 Replies Latest reply on Jul 26, 2007 9:41 AM by Andreas_M

    MIAW to drag with stage

    Opera Rat Level 1
      Is it possible to have the MIAW drag around with the stage and keep its location? I want the MIAW to always be on top, but not as a dialog box, so I don't know if it matters what kind of movies the stage and the MIAW are. Right now I have the stage as a document and the MIAW as a tool.
        • 1. Re: MIAW to drag with stage
          Level 7
          If I understand correctly, you want to drag the stage window and have
          the MIAW maintain the same relative location. If so, you need to update
          the rect of the MIAW when the stage window moves. I think you'll need to
          monitor the stage location from a regularly called handler like
          enterFrame - or a timeout. Unfortunately there's no built-in #moveWindow
          event.
          • 2. Re: MIAW to drag with stage
            Andreas_M
            Hi, I use this script and it works fine.

            --moviescript

            on preparemovie
            global gstagepos
            (the stage).rect = gstagepos
            end preparemovie

            on updatestage
            global gstagepos
            if windowpresent ("your miaw")= true then
            if (the stage).rect <> gstagepos then
            set a = the stageleft
            set b = the stagetop +728 --Position from top
            set c = the stageright
            set d = the stagebottom
            set the rect of window "your miaw" to rect(a,b,c,d)
            movetofront window "your miaw"
            else
            nothing
            end if
            else
            nothing
            end if
            end

            on stopmovie
            global gstagepos
            gstagepos = (the stage).rect
            (the stage).rect = gstagepos
            end stopmovie

            I hope i can help you with this script!

            Libo
            • 3. Re: MIAW to drag with stage
              Andreas_M Level 1
              Hi,
              this script is better!!!!

              on preparemovie
              global gstagepos
              (the stage).rect = gstagepos
              end preparemovie

              on enterframe
              global gstagepos, a
              if windowpresent ("your miaw")= true then
              if (the stage).rect <> gstagepos and a <> the stageleft then
              set a = the stageleft
              set b = the stagetop +728 --Position from top
              set c = the stageright
              set d = the stagebottom
              set the rect of window "your miaw" to rect(a,b,c,d)
              movetofront window "your miaw"
              else
              nothing
              end if
              else
              nothing
              end if
              end

              on stopmovie
              global gstagepos
              gstagepos = (the stage).rect
              (the stage).rect = gstagepos
              end stopmovie
              the bold text is new

              Libo