/ Published in: ActionScript 3
Taken from Christian Cantrell's Adobe article called 'Authoring mobile Flash content for multiple screen sizes'.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function center(foreground:DisplayObject, background:DisplayObject):void { foreground.x = (background.width / 2) - (foreground.width / 2); foreground.y = (background.height / 2) + (foreground.height / 2); }
URL: http://www.adobe.com/devnet/flash/articles/authoring_for_multiple_screen_sizes.html