Laurence, yes.

Just create a utility function like and for center the container each time
the browser resize, you just add a eventlistener to the stage of app like.


import flash.display.DisplayObject;
import mx.events.ResizeEvent;

public static function centerMyContainer(target:DisplayObject):void {
    target.x =  this.width/2 - target.width * 0.5;
    target.y = this.height / 2 - target.height * 0.5;

  }
  private function init():void {
   addEventListener(ResizeEvent.RESIZE, centerit);
   // called in property like creationComplete on mx:Application tag
  }
  private function centerIt(e:ResizeEvent):void {
   centerMyContainer(yourComp);
  }

}

Regards
Igor
www.igorcosta.org


On Sat, May 16, 2009 at 8:13 PM, Laurence MacNeill <[email protected]>wrote:

>
>
> Is there a way I can center my app in the browser window? And keep
> it there if/when the browser is re-sized?
>
> Thanks,
>
> Laurence MacNeill
> Mableton, Georgia, USA
>
> 
>



-- 
----------------------------
Igor Costa
www.igorcosta.com
www.igorcosta.org

Reply via email to