Building Full Screen Mode UcompOS Implementations

Since the release of Adobe Flash Player 9 in 2006, the Flash Player is capable of entering into what is known as “Full Screen Mode“.

In Full Screen Mode, the content playing in the Flash Player takes over the entire viewport of the display device such that the only content in view and capable of being interacted with is the content currently being executed in the Flash Player.

Depending on the nature of your application, this can in some circumstances create a much more focused and positive experience for your users.

The UcompOS Portal is configured to operate in Full Screen Mode and the UcompOS SDK provides a means for sending the UcompOS Portal into Full Screen Mode from one of your UcompOS applications or sub-applications.

Of course there are some rules and principles to observe when leveraging the power of Full Screen Mode in your UcompOS Applications.

In my blog posting on the Mechanics of UcompOS Desktop (AIR 2.0) Applications, we learned that the launching of an AIR application by the Flash Player must be preceded by a user-triggered mouse event.

The same rule applies to entering into Full Screen Mode.

The UcompOSGlobalManagerProxy class has two pertinent methods:  enterFullScreenMode(); and exitFullScreenMode();.

Both of these methods accept an optional single input parameter, message, of type String.

When you call either of these methods from one of your UcompOS applications or sub-applications, in order to generate the compulsory user mouse click, the UcompOS Portal throws up an Alert dialogue asking the user if they want to allow the request to go into or out of full screen mode.

Of course having the dialogue appear for exitFullScreenMode(); calls is somewhat dubious as all the user needs to do is hit the Escape key on their computer to break out of Full Screen Mode but for continuity, I have decided to keep the mechanics of throwing the Alert in calls to both enterFullScreenMode(); and exitFullScreenMode();.

The optional message parameter lets you customize the text that is presented on the Alert dialogue.

When the UcompOS Portal breaks into or out of Full Screen Mode, a Continuum Event (an instance of the SDKEvent class) of type UcompOSGlobalManagerProxy.SCREEN_MODE_CHANGE is broadcast.

The data Object of the event will have a state property with a literal string value of “normal” or “fullScreen” so that your applications and sub-applications can behave accordingly when the user enters/exits Full Screen Mode.

In the scenario we discussed in my AIR 2.0 UcompOS Applications posting mentioned above, we saw we can leverage the UcompOSArtifactProxy class to create a clickable UcompOS Artifact that immediately launches a particular AIR application (with the aid of the UcompOSAIRProxy class).

This same concept is also available with Full Screen Mode implementations.  You can create a UcompOS Artifact and assign its data Object special properties that tell the UcompOS Portal to launch or exit Full Screen Mode when the artifact is clicked on.

The property names will be enterFullScreenMode and exitFullScreenMode and both should be of type Boolean with a value of  true.

They should be mutually exclusive and you should not have the enterFullScreenMode and exitFullScreenMode properties set on the artifact’s data Object simultaneously.  If you do, the exitFullScreenMode property takes precedent.

Let’s look at a simple code-driven example:

private var artifact:UcompOSArtifactProxy;
 
private function start():void
{
 
 SDKClient.getInstance(this);
 UcompOSGlobalManagerProxy.getInstance().addEventListener
(UcompOSGlobalManagerProxy.SCREEN_MODE_CHANGE,screenModeChangeHandler);
 artifact = new UcompOSArtifactProxy();
 artifact.add(null,null,"http://www.server.com/enterFullScreenModeImage.png");
 artifact.data = {enterFullScreenMode:true};
 
}
 
private function screenModeChangeHandler(event:SDKEvent):void
{
 
 switch(event.data.state)
 {
 
 case "fullScreen":
 artifact.data = {exitFullScreenMode:true};
 artifact.setImage(null,"http://www.server.com/exitFullScreenModeImage.png");
 break;
 case "normal":
 artifact.data = {enterFullScreenMode:true};
 artifact.setImage(null,"http://www.server.com/enterFullScreenModeImage.png");
 
 }
 
}

An important point to make about Full Screen Mode implementations, at this time, UcompOS HTML content cannot be displayed while in full-screen mode.  UcompOS HTML applications and sub-applications rely on an iframe implementation which is outside the visual scope of the Flash Player.

UcompOS HTML entities can still be interacted with via Proxy Components while in Full Screen Mode however.

The same applies to UcompOS AIR 2.0 content.  It cannot be in view while the in Full Screen Mode but it can be interacted with by Proxy Component-driven interactions.