I’ve been asked to help with a flash site:
http://tomix.110mb.com/
(Click on the center of the comics page)
The owner of the site wants to center a symbol in the middle of stage.
I am not familiar with Adobe Flash, only with AS3 and I suggested he’d use
symbol.x = stage.stageWidth / 2;
I am not even sure he is using AS3.
He also asked where to put the script(I have no clue, I don’t use Adobe Flash).
Please note you can scroll the site left and right so you can’t just calculate x in advance. It has to move as you scroll the page.
Many thanks
Unless
symbolis already centered around it’s own origin, you may need to modify your suggestion to:symbol.x = (stage.stageWidth - symbol.width) / 2;As for where to put this line of code, there’s not enough info to give a decisive answer. Most likely, this line should come after
symbolis instantiated. If the site resizes dynamically, then it should be inside the resize handler. Ifsymbolis not instantiated programmatically, then it should be where ever the object placed on the stage with the instance name “symbol” is accessible.