In the simple case where the popup has its width and you can guarantee the 
popup is smaller than the stage, I think it is as simple as:

Popup.x = Math.max(0, Math.min(popup.x, stage.stageWidth - popup.width));

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: [email protected] [mailto:[email protected]] On Behalf 
Of Tracy Spratt
Sent: Saturday, February 21, 2009 11:08 AM
To: [email protected]
Subject: [flexcoders] Positioning logic for pop-up?


I need to constain a popup to stay with the application boundries.

I will certainly be able to grind this logic out, but am wondering if
anyone might have done it already.

Hmm, if I can find a standard component that does this, that would also
be a place to look.

Tracy Spratt
Lariat Services

Flex development bandwidth available

Reply via email to