3 Replies Latest reply on May 19, 2006 11:35 AM by GRAMOPHONE

    POISITINING MIAWS

    GRAMOPHONE Level 1
      Hi
      I have this buttom script to position a window relative to the stage.

      on mouseUp
      global MyWindow,
      MyWindow = window().new("TestWin")
      open MyWindow
      MyWindow = (the stageLeft + 300)
      tell window "TestWin"
      go to "Green"
      end tell
      end

      The problem is that the window keeps opening in the center of the stage.
      What am I doing wrong?

      Thanks
        • 1. Re: POISITINING MIAWS
          Level 7
          You need to get rid of this line:

          'MyWindow = (the stageLeft + 300)'

          If you are trying to position the window with this, it won't work, not to
          mention you are overwriting the variable holding your window object.

          After you create the window and before you open it, you can set it's rect
          property, which lets you position and size the window. Let's say the MIAW
          movie size is 320x320 and you want to position it below the stage and
          aligned along the left side of the stage.

          MyWindow = window().new("TestWin")
          MyWindow.rect = rect(the stageLeft,the stageBottom,the stageLeft + 320,the
          stageBottom + 320)
          open MyWindow


          "GRAMOPHONE" <webforumsuser@macromedia.com> wrote in message
          news:e4kphn$e38$1@forums.macromedia.com...
          > Hi
          > I have this buttom script to position a window relative to the stage.
          >
          > on mouseUp
          > global MyWindow,
          > MyWindow = window().new("TestWin")
          > open MyWindow
          > MyWindow = (the stageLeft + 300)
          > tell window "TestWin"
          > go to "Green"
          > end tell
          > end
          >
          > The problem is that the window keeps opening in the center of the stage.
          > What am I doing wrong?
          >
          > Thanks
          >


          • 2. Re: POISITINING MIAWS
            GRAMOPHONE Level 1
            That's great!
            Now, let's guess that I that I don't want my window align to the left, but 200 pixels away from the left and 300 pixels away from the buttom. How can I accomplish this leaving the same size of the window?
            • 3. Re: POISITINING MIAWS
              GRAMOPHONE Level 1
              Thanks,
              I figured it out!