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
