Friday, May 16, 2008

Creating FullScreen Flex/AIR/Flash Applications

Going Fullscreen in Actionscript

The main stage for the AIR application has a displayState property. The framework also contains a class, StageDisplayState, that defines three constants for the three different display states. By using these classes you can put your AIR application into any of the three display states .

PLAIN TEXTActionscript:
// Enter Fullscreen Interactive State
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
or
// Enter Standard Fullscreen State
stage.displayState = StageDisplayState.FULL_SCREEN;
or
// Enter Normal State
stage.displayState = StageDisplayState.NORMAL;

we can use these as follows :-








Going Fullscreen through JavaScript

The logic works exactly the same in JavaScript as it does in Actionscript, but the classpaths are different. You can see the examples below in Code Example 2.

PLAIN TEXTJavaScript:
// Enter Fullscreen Interactive State
window.nativeWindow.stage.displayState = runtime.flash.display.StageDisplayState.FULL_SCREEN_INTERACTIVE;
or
// Enter Standard Fullscreen State
window.nativeWindow.stage.displayState = runtime.flash.display.StageDisplayState.FULL_SCREEN;
or
// Enter Normal State
window.nativeWindow.stage.displayState = runtime.flash.display.StageDisplayState.NORMAL;


Cheers

Varun Rathore

No comments:

About Me