I had the exact same problem. I solved it by using move() instead of
setting the x and y.

this.move((_root.width - this.width) / 2, (_root.height - this.height) /
2, false);

I am calling this code on creationComplete in the popup class.

Paul 

-----Original Message-----
From: bobpardoe1959 [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 12, 2004 6:23 AM
To: [email protected]
Subject: [flexcoders] setting x and y on creationComplete event for a
popup causes bug

I am trying to centre my popoup screen (which is an mxml TitleWindow
component) by using the creationComplete event to do the following

this.x = (parentDocument.width / 2) - (this.width / 2); this.y =
(parentDocument.height / 2) - (this.height / 2);

What happens is that the shadow is in one location and the topmost layer
with the controls on it is in another. They are about 100 pixels apart
on the y axis, on the x axis they line up.

Clicking on the titlebar realigns them, but that is hardly the point.

Any ideas ?

BOb



Yahoo! Groups Sponsor    
ADVERTISEMENT
click here
<http://rd.yahoo.com/SIG=129d4qli5/M=295196.4901138.6071305.3001176/D=gr
oups/S=1705007207:HM/EXP=1084451174/A=2128215/R=0/SIG=10se96mf6/*http://
companion.yahoo.com>    
 
<http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=group
s/S=:HM/A=2128215/rand=547780966>       

________________________________

Yahoo! Groups Links


*       To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
          
*       To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
          
*       Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> . 




Reply via email to