views:

71

answers:

1

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 TalentInfoPopUp is **TitleWindow

This is my sample 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>maxWidth-width)
    {
        nx=nx-width;
    }
    if(ny>maxHeight-height)
    {
        ny=ny-height;
    }

    this.move(nx,ny); 
}
A: 

Try using systemManager.screen.width and systemManager.screen.height instead of stage.width and stage.height; also learn about the localToGlobal and globalToLocal methods and how to use them.

Robusto
Hi thanx for replying this almost working fine after changing to Screen.width and screen.height. I am displaying two rows of images in Customized TileList first row of images the mouse over is working fine. When it comes on second row last image mouse over is coming and hiding its not stable. Is there any wrong in my calculation ?
Can you post your new code?
Robusto