View Single Post
Old 11-08-2007   #9 (permalink)
agentxi
photoshop ninja
 
agentxi's Avatar
 
Join Date: Oct 2006
Location: Red Deer - ish, alberta
Posts: 516

Quote:
To center something that is aligned to the left is pretty simple, you just need to think a little differently about what's going on. Say you have a Movie Clip centered vertically and horizontally on the Stage. Well, the top-left corner, where the registration point is, is located a little off-center. In fact, it is located at the center (which equals half the width of the Stage), minus half the Movie Clip's width and minus half the Movie Cli's height. So to center that with ActionScript, you simply place it:

myMovieClip._x = (Stage.width/2) - (myMovieClip._width/2);
myMovieClip._y = (Stage.height/2) - (myMovieClip._height/2);

Or, to center one Movie Clip within another (like an image within a frame):

mcImg._x = mcFrame._x + ((mcFrame._width/2)-(mcImg._width/2));
mcImg._y = mcFrame._y + ((mcFrame. _height/2)-(mcImg. _height/2));
i found this snippet from another forum

Just don't tell tamlin i went elsewhere for information
__________________

Your a Graphic Designer...If you could go back in time you wouldn't go back to see the rise and fall of civilizations, you'd go back in time to destroy comic sans and papyrus.
agentxi is offline   Reply With Quote