mApplication.onScreenChange()

Availability

SupportPCMacPackage (AS3) / Scope (AS2)
ActionScript 3.0

ActionScript 2.0

2.0 or later

1.2.1 or later

global

Usage

mApplication.onScreenChange = function () {
   // your statements here
}

Parameters

None.

Returns

Nothing.

Description

Event handler; An event handling function called after the screen-size or color-depth settings change.

This AS2 event handler function is replaced by a standard event object in AS3: see mApplicationEvent.SCREEN_CHANGE

ActionScript 2.0 Example:

The following example sets a new onScreenChange event handling function.

mApplication.onScreenChange = function (
{
    var Size = mSystem.getScreenSize();
    switch (Size.x)
    {
        case 1280:
            gotoAndPlay(100);
            break;
        case 1024:
            gotoAndPlay(101);
            break;
        case 800:
            gotoAndPlay(102);
            break;
    }
}

See Also

mApplicationEvent.SCREEN_CHANGE

Code Examples

Screen Resolution