views:

230

answers:

1

I have a Flash presentation (made in Flash CS4 with AS3) I am working on and running in a standalone Flash player. When I start the presentation the stage is centered in the Flash player, even if I resize it. The presentation contains an FLVPlayback component which, at different frames, plays different content. A navigation menu (made of buttons) is used to move through the different frames.

My problem is that if the player is resized so that it is bigger than the stage, sometimes after going into and exiting from fullScreen mode, the stage is moved to the left and I cannot find a way to move it back to the center. I cannot stage the scale as the content becomes distorted and I do not want to force fullScreen all the time. I would just like to center the stage in the Flash player.

Is such a thing possible? Any help is greatly appreciated.

A: 

you can set the scaleMode to NO_SCALE, and the align to TOP_LEFT. then the player will not resize or center anything manually. you can then register a resize handler, read out the stageHeight and stageWidth of the stage and center your root sprite (document class instance) within it.

greetz
back2dos

back2dos
I had already figured out all the steps you mentioned except the "center your root sprite" part. I tried setting stage.x and stage.y but it does not do anything. I am not used to AS3 - in AS2 I would have simply have moved root but I cannot seem to find the equivalent in AS3. Thanks a lot for your help.
Technoh
@Technoh: well, whatever your document class is, you'll have to position that one accordingly. The easiest thing to do, is to put the centering mechanism into the document class and simply refer to it with `this`.
back2dos