Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Hey, there isn't a simple setting to prevent this from happening from my knowledge. All you need to do is watch it every time it moves and make sure it stays within certain bounds. You could then abstract that event handler into some Controller class if you'd like.</p> <p>Here's a basic example:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="creationCompleteHandler()"&gt; &lt;fx:Script&gt; &lt;![CDATA[ import flash.geom.Rectangle; import mx.core.FlexGlobals; import mx.core.UIComponent; import mx.events.MoveEvent; import mx.managers.PopUpManager; import spark.components.TitleWindow; protected function creationCompleteHandler():void { var window:TitleWindow = new TitleWindow(); PopUpManager.addPopUp(window, this, false); PopUpManager.centerPopUp(window); window.addEventListener(MoveEvent.MOVE, window_moveHandler); } protected function window_moveHandler(event:MoveEvent):void { var window:UIComponent = event.currentTarget as UIComponent; var application:UIComponent = FlexGlobals.topLevelApplication as UIComponent; var bounds:Rectangle = new Rectangle(0, 0, application.width, application.height); var windowBounds:Rectangle = window.getBounds(application); var x:Number; var y:Number; if (windowBounds.left &lt;= bounds.left) x = bounds.left; else if (windowBounds.right &gt;= bounds.right) x = bounds.right - window.width; else x = window.x; if (windowBounds.top &lt;= bounds.top) y = bounds.top; else if (windowBounds.bottom &gt;= bounds.bottom) y = bounds.bottom - window.height; else y = window.y; window.move(x, y); } ]]&gt; &lt;/fx:Script&gt; &lt;/s:Application&gt; </code></pre> <p>Hope that helps, Lance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload