It is likely that you will want to update your app's on-screen content to reflect a change in the device's physical orientation. While auto-orientation in conjunction with the stage's default alignment and scale mode will attempt this on your behalf, you may want to handle the layout yourself.
This recipe will show you how to do that.
An FLA has been provided as a starting point. From the book's accompanying code bundle, open chapter8\recipe7\recipe.fla
within Flash Professional.
You will find two movie clips sitting on the stage. The first movie clip is an image of an arrow pointing upwards and has been created to fit the screen's dimensions using a portrait orientation. The second shows the same arrow but this time the image's dimensions fit the screen's landscape orientations.
Both movie clips are positioned at the top-left corner of the stage and have instance names of portrait
and landscape
respectively.
We will write some code to ensure that...