Monday, January 11, 2010

Creating full-screen Flex applications

Creating full-screen Flex applications: "
Here is a quick post on using Flash Player 9’s Full-Screen Mode in Flex. I’ve seen this appear a few times in the bugbase and on lists, but here is some simple code to let you toggle between “full screen mode” and “normal mode” in a Flex application. Note that in this example I’m listening for the applicationComplete event in the main <mx:Application /> tag instead of the creationComplete event. The applicationComplete tag is called slightly after the creationComplete event, after the Application has been completely initialized.

If you try and access the Application.application.stage property from the creationComplete event, you’ll get a run-time error (RTE) saying the following:


TypeError: Error #1009: Cannot access a property or method of a null object reference.

at main/init()

at main/___main_Application1_creationComplete()

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at mx.core::UIComponent/dispatchEvent()

at mx.core::UIComponent/set initialized()

at mx.managers::LayoutManager/doPhasedInstantiation()

at Function/http://adobe.com/AS3/2006/builtin::apply()

at mx.core::UIComponent/callLaterDispatcher2()

at mx.core::UIComponent/callLaterDispatcher()

The example below is pretty bare with just a few Label controls and a Button control, but it should have enough of the required code to give you a push in the right direction.

Full code after the jump.

(more…)

flex full screen

No comments:

Post a Comment

Your comments is appreciate.