Skip to content

Md#47

Merged
usernamealreadyis merged 7 commits into
masterfrom
md
Jun 26, 2016
Merged

Md#47
usernamealreadyis merged 7 commits into
masterfrom
md

Conversation

@usernamealreadyis

Copy link
Copy Markdown

No description provided.

Controlling Stage scaling

When the portion of the screen representing Flash Player or AIR is resized, the runtime automatically adjusts the Stage contents to compensate. The Stage class’s scaleMode property determines how the Stage contents are adjusted. This property can be set to four different values, defined as constants in the flash.display.StageScaleMode class:

    StageScaleMode.EXACT_FIT scales the SWF to fill the new stage dimensions without regard for the original content aspect ratio. The scale factors might not be the same for width and height, so the content can appear squeezed or stretched if the aspect ratio of the stage is changed.

    StageScaleMode.SHOW_ALL scales the SWF to fit entirely within the new stage dimensions without changing the content aspect ratio. This scale mode displays all of the content, but can result in “letterbox” borders, like the black bars that appear when viewing a wide-screen movie on a standard television.

    StageScaleMode.NO_BORDER scales the SWF to entirely fill the new stage dimensions without changing the aspect ratio of the content. This scale mode makes full use of the stage display area, but can result in cropping.

    StageScaleMode.NO_SCALE — does not scale the SWF. If the new stage dimensions are smaller, the content is cropped; if larger, the added space is blank.

    In the StageScaleMode.NO_SCALE scale mode only, the stageWidth and stageHeight properties of the Stage class can be used to determine the actual pixel dimensions of the resized stage. (In the other scale modes, the stageWidth and stageHeight properties always reflect the original width and height of the SWF.) In addition, when scaleMode is set to StageScaleMode.NO_SCALE and the SWF file is resized, the Stage class’s resize event is dispatched, allowing you to make adjustments accordingly.

    Consequently, having scaleMode set to StageScaleMode.NO_SCALE allows you to have greater control over how the screen contents adjust to the window resizing if you desire. For example, in a SWF containing a video and a control bar, you might want to make the control bar stay the same size when the Stage is resized, and only change the size of the video window to accommodate the Stage size change. This is demonstrated in the following example:
@usernamealreadyis usernamealreadyis added this to the Bug 1130559 milestone Jun 26, 2016
@GistIcon GistIcon locked and limited conversation to collaborators Jun 26, 2016
@usernamealreadyis usernamealreadyis merged commit daac4de into master Jun 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant