This content has been marked as final. Show 5 replies
> Hi, I was wondering if it is possible to use code to
> set the center point of a Sprite and/or a MovieClip
> to better handle zoom and rotation...
You mentioned Sprite, which leads me to believe you're talking about
ActionScript 3.0. Either which way -- AS3 or AS2 -- I tend to use this
approach: create your movie clip (or sprite), draw or load its content,
then, when it has a width and height of its own, wrap it in a container
movie clip (or sprite) and offset the x and y coordinates of the first by
minus half its width and height. From the point of view of the container,
that gives you a centered registration point. Naturally, you can position
the inner object by its lower right corner, or anywhere else, using the same
Co-author, Foundation Flash CS3 for Designers
"Luck is the residue of good design."
there's no way to do that. you can fake it, but even that's not easy.
Yeah, I was afraid to get this answer... I need to do this since old times of as2 without much success... Anyway, thanks a lot...
with as2 there is a publically available class that will do the abstract thinking for you. otherwise, you just have to wrap your head around ds'es suggestion.
after thinking about ds'es answer i realized this is much easier in as3 than it was in as2 because you can re-parent displayobjects. here's a class that does just that and fakes a reg point change: