centerObject(obj); //Centers a display object
function centerObject(obj:DisplayObject):void {
obj.x = stage.stageWidth / 2 - obj.width / 2;
obj.y = stage.stageHeight / 2 - obj.height / 2;
}
Welcome to my actionscript snippet library!
Actionscript Snips is a small repository of actionscript code that aims to save developers and designers time when developing a website.
Center A Display Object
Posted by
admin
on Friday, October 23, 2009
Labels:
Objects
0 comments:
Post a Comment