title: How to show PopUp with in the screen area In Flex and AS3
body: <p>Hi i am trying to show my popup on the image mouse over 
  it is showing fine 
  when i trying mouse over right side last images popup is going out of the screen
  Here <strong>TalentInfoPopUp is **TitleWindow</strong></p>
  
  <p>This is my sample code</p>
  
  <pre><code>private static var staticWindow :TalentInfoPopUp = null;  
  private static var visibleWindow:TalentInfoPopUp = null;
  
  public static function show(t:Object, parent : DisplayObject, x:Number , y:Number):void
  {
  if(staticWindow == null)
  {
  visibleWindow = staticWindow = PopUpManager.createPopUp( parent , TalentInfoPopUp , false) as TalentInfoPopUp;
      }
  
      else if(visibleWindow == null)
      { 
          visibleWindow = staticWindow;
          PopUpManager.addPopUp(staticWindow, parent, false);
  
      }
  
      PopUpManager.centerPopUp(staticWindow);
  
      staticWindow.talent = t;
      staticWindow.x = x;
      staticWindow.y =y;      
  
      PopUpManager.bringToFront(staticWindow);
      staticWindow.talent = t;
      staticWindow.move(x,y);
      staticWindow.callLater(staticWindow.setPosition,[x,y]);
      //staticWindow.setPosition(x,y);
  
  }
  
  
  
  private function setPosition(nx:int,ny:int):void
  {
      var maxWidth:int =  stage.width ;
      var maxHeight:int = stage.height;
  
      if(nx&gt;maxWidth-width)
      {
          nx=nx-width;
      }
      if(ny&gt;maxHeight-height)
      {
          ny=ny-height;
      }
  
      this.move(nx,ny); 
  }
  </code></pre>