5 Replies Latest reply on Aug 18, 2006 10:31 PM by mariusvz

    MIAW CENTERING!  Please help!!!

    korkster911
      I am so frustrated right now. Director MX2004 and MIAW's is a pain in the A$$! 8.5 worked, 2004 doesn't!

      Now that I've vented, here's my problem. I have a director movie, it's opening a MIAW and I want it centered on the screen.... That's it, that all. Nothing fancy or anything.

      Please help, I promised the client a finished disc tomorrow, This minor mod was supposed to be SIMPLE!
        • 1. Re: MIAW CENTERING!  Please help!!!
          Level 7
          Open your MIAW movie, go to the the Display Template tab of the property
          inspector. Check the Centered box.

          When you write the code to open the MIAW, just use:

          window().new("moviename.dir")
          window("moviename.dir").open()

          don't specify a rect. The MIAW should open at it's normal size centered
          on the monitor.

          --
          Rob
          _______
          Rob Dillon
          Adobe Community Expert
          http://www.ddg-designs.com
          412-243-9119

          http://www.macromedia.com/software/trial/
          • 2. MIAW CENTERING!  Please help!!!
            korkster911 Level 1
            Based on the Director documentation, I should be able to set the display template property "centered" to true... Unfortunately, what it seems to do instead is simply center the stage based on my current resolutions. When I protect it and convert to a dxr, as a MIAW when openedfrom a MIAW it moves immediately to that position based on the "development" screen resolution, not centered on the end users screen. I even find that the "centered" checkbox is unchecked when I save and open the file again?

            What is the point of the functionality and how can I center?



            • 3. Re: MIAW CENTERING!  Please help!!!
              korkster911 Level 1
              No more takers why "center" doesn't work?
              • 4. Re: MIAW CENTERING!  Please help!!!
                Level 7
                Here is the awesome doc on "Setting the window size and location for a MIAW"

                Setting the screen coordinates for a MIAW lets you control the size of the
                window and where it appears. Setting the coordinates before the movie
                appears controls the initial position of the window; setting them after the
                window appears moves the window.

                Oh great! Just paste that into your script.

                Anyhow, I hope the following helps you:

                As far as the check box becoming unchecked, I've found it you open the
                source with MX, then reopen it with 2004 some boxes switch to checked and
                some switch to unchecked. So it could be from going between versions.

                What you are going to need to do is get the 1st item in the desktop rect
                list, and you will have the rect of the 1st monitor and find the center
                (divde the width and height by 2). Then you will need to know the dimensions
                of your MIAW. Then I believe you divide you miaw dimensions by 2, subtract
                from the center to get the upper left, add to the center to get your lower
                right. Then you have the rect you need to thow your miaw into. In my line of
                code below, window(whichfile2).rect = the desktoprectlist[which] , you would
                have it = the rect you came up with in your calculations.

                Here is known working code:
                whichFile2 = "display-pvdata" --the director file to be opened as a miaw
                window().new(whichfile2)
                window(whichfile2).fileName = whichFile2
                window(whichfile2).type = #tool
                window(whichfile2).titlebarOptions.visible = false
                window(whichfile2).rect = the desktoprectlist[which]
                window(whichfile2).open()

                Timm

                "korkster911" <webforumsuser@macromedia.com> wrote in message
                news:ec1pqr$qr$1@forums.macromedia.com...
                > Can anybody shed some light on this?
                >
                > Based on the Director documentation, I should be able to set the display
                > templaye property "centered" to true... Unfortunately, what it seems to
                > do
                > instead is simply center the stage based on my current resolutions. When
                > I
                > protect it and convert to a dxr, as a MIAW when opened from the parent
                > projhector moves immediately to that position based on the "development"
                > screen
                > resolutions, not centered as I had indicated. I even find that the
                > "centered"
                > checkbox is unchecked when I save and open the file again?
                >
                > What is the point of the functionality and Ihow can I center?
                >
                >
                >
                >
                >


                • 5. Re: MIAW CENTERING!  Please help!!!
                  mariusvz
                  Hi, here is my working code also...
                  Did this some time ago after struggling forever with the "centered" checkbox which kept on reverting to unchecked!!!!

                  Depending on your MIAW size, you need to specify some numbers...

                  window().new(vMovie)
                  window(vMovie).filename = vMoviePath
                  window(vMovie).drawrect = rect(0, 0, 650, 520)
                  window(vMovie).rect = (_movie.stage.rect) + rect(75, 40, -75, -40)
                  window(vMovie).open()

                  My main movie is 800x600
                  My MIAW is 650x520

                  So (800 - 650) / 2 = 75
                  and (600 - 520) / 2 = 40

                  Maybe there is an easier way? This works for me.

                  Ciao
                  Marius