This content has been marked as final. Show 5 replies
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:
don't specify a rect. The MIAW should open at it's normal size centered
on the monitor.
Adobe Community Expert
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?
No more takers why "center" doesn't work?
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(whichfile2).fileName = whichFile2
window(whichfile2).type = #tool
window(whichfile2).titlebarOptions.visible = false
window(whichfile2).rect = the desktoprectlist[which]
"korkster911" <firstname.lastname@example.org> wrote in message
> 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
> instead is simply center the stage based on my current resolutions. When
> 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"
> resolutions, not centered as I had indicated. I even find that the
> checkbox is unchecked when I save and open the file again?
> What is the point of the functionality and Ihow can I center?
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(vMovie).filename = vMoviePath
window(vMovie).drawrect = rect(0, 0, 650, 520)
window(vMovie).rect = (_movie.stage.rect) + rect(75, 40, -75, -40)
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.