Qbe
March 26th, 2008, 07:30 AM
Hi
I need to expand my flashmovie to fullscreen, so I foud this tutorial: http://blog.flexexamples.com/2007/08/07/creating-full-screen-flex-applications/
But I can't gett it to work.
I've tryed to write it i my own Flexfile, and I've tryed copy/paste, that's the last section.
This is my code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application applicationComplete="init(event);" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="300" height="200">
<mx:Script>
<![CDATA[
/* import flash.display.Sprite
import flash.events.MouseEvent
import flash.display.StageDisplayState
import mx.managers.SystemManager
private var background:Sprite;
private var button:Sprite;
private var dispState;
private function init():void
{
background = new Sprite();
background.graphics.beginFill(0x116699);
background.graphics.drawRect(0, 0, 300, 200);
background.graphics.endFill();
parent.addChild(background);
button = new Sprite();
button.graphics.beginFill(0x996611);
button.graphics.drawRect(0, 0, 100, 50);
button.graphics.endFill();
button.addEventListener(MouseEvent.CLICK, toggleFullScreen);
parent.addChild(button);
systemManager.stage.addEventListener(FullScreenEve nt.FULL_SCREEN, fullHandler);
dispState = systemManager.stage.displayState;
}
/*private function clickHandler(event:MouseEvent):void
{
trace("Clicking");
}
private function fullHandler(event:FullScreenEvent):void
{
trace("UBBE!");
dispState = systemManager.stage.displayState + "(fullScreen=" + event.fullScreen.toString() + ")";
if(event.fullScreen)
{
}
else
{
}
// toggleFullScreen();
}
private function toggleFullScreen(event:MouseEvent):void
{
try
{
switch(systemManager.stage.displayState)
{
case StageDisplayState.FULL_SCREEN:
systemManager.stage.displayState = StageDisplayState.NORMAL;
break;
default:
trace("MAKE FULL"); //Is traced
systemManager.stage.displayState = StageDisplayState.FULL_SCREEN;
break;
}
}
catch(error:SecurityError){}
}*/
import flash.display.StageDisplayState;
var dispState;
private function init(evt:Event):void {
/* Set up full screen handler. */
trace("INIT");
Application.application.stage.addEventListener(Ful lScreenEvent.FULL_SCREEN, fullScreenHandler);
dispState = Application.application.stage.displayState;
}
private function fullScreenHandler(evt:FullScreenEvent):void {
dispState = Application.application.stage.displayState + " (fullScreen=" + evt.fullScreen.toString() + ")";
trace("HANDLER " + evt.fullScreen); //This is not traced
if (evt.fullScreen) {
/* Do something specific here if we switched to full screen mode. */
} else {
/* Do something specific here if we switched to normal mode. */
}
}
private function toggleFullScreen():void {
try {
switch (Application.application.stage.displayState) {
case StageDisplayState.FULL_SCREEN:
/* If already in full screen mode, switch to normal mode. */
Application.application.stage.displayState = StageDisplayState.NORMAL;
break;
default:
/* If not in full screen mode, switch to full screen mode. */
trace("NORMAL"); //This is traced, but nothing happens.
Application.application.stage.displayState = StageDisplayState.FULL_SCREEN;
break;
}
} catch (err:SecurityError) {
// ignore
}
}
]]>
</mx:Script>
<mx:Button label="FullScreen" click="toggleFullScreen()" />
</mx:Application>
And this is my HTMLobject:
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="FullScreen" width="300" height="200"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="FullScreen.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<embed src="FullScreen.swf" quality="high" bgcolor="#869ca7"
width="300" height="200" name="FullScreen" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
allowFullScreen="true"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</noscript>
The only thing I've done is this line: <paramname="allowFullScreen"value="true"/> and allowFullScreen="true"
It don't work, anyone who can help me?
Thank you
I need to expand my flashmovie to fullscreen, so I foud this tutorial: http://blog.flexexamples.com/2007/08/07/creating-full-screen-flex-applications/
But I can't gett it to work.
I've tryed to write it i my own Flexfile, and I've tryed copy/paste, that's the last section.
This is my code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application applicationComplete="init(event);" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="300" height="200">
<mx:Script>
<![CDATA[
/* import flash.display.Sprite
import flash.events.MouseEvent
import flash.display.StageDisplayState
import mx.managers.SystemManager
private var background:Sprite;
private var button:Sprite;
private var dispState;
private function init():void
{
background = new Sprite();
background.graphics.beginFill(0x116699);
background.graphics.drawRect(0, 0, 300, 200);
background.graphics.endFill();
parent.addChild(background);
button = new Sprite();
button.graphics.beginFill(0x996611);
button.graphics.drawRect(0, 0, 100, 50);
button.graphics.endFill();
button.addEventListener(MouseEvent.CLICK, toggleFullScreen);
parent.addChild(button);
systemManager.stage.addEventListener(FullScreenEve nt.FULL_SCREEN, fullHandler);
dispState = systemManager.stage.displayState;
}
/*private function clickHandler(event:MouseEvent):void
{
trace("Clicking");
}
private function fullHandler(event:FullScreenEvent):void
{
trace("UBBE!");
dispState = systemManager.stage.displayState + "(fullScreen=" + event.fullScreen.toString() + ")";
if(event.fullScreen)
{
}
else
{
}
// toggleFullScreen();
}
private function toggleFullScreen(event:MouseEvent):void
{
try
{
switch(systemManager.stage.displayState)
{
case StageDisplayState.FULL_SCREEN:
systemManager.stage.displayState = StageDisplayState.NORMAL;
break;
default:
trace("MAKE FULL"); //Is traced
systemManager.stage.displayState = StageDisplayState.FULL_SCREEN;
break;
}
}
catch(error:SecurityError){}
}*/
import flash.display.StageDisplayState;
var dispState;
private function init(evt:Event):void {
/* Set up full screen handler. */
trace("INIT");
Application.application.stage.addEventListener(Ful lScreenEvent.FULL_SCREEN, fullScreenHandler);
dispState = Application.application.stage.displayState;
}
private function fullScreenHandler(evt:FullScreenEvent):void {
dispState = Application.application.stage.displayState + " (fullScreen=" + evt.fullScreen.toString() + ")";
trace("HANDLER " + evt.fullScreen); //This is not traced
if (evt.fullScreen) {
/* Do something specific here if we switched to full screen mode. */
} else {
/* Do something specific here if we switched to normal mode. */
}
}
private function toggleFullScreen():void {
try {
switch (Application.application.stage.displayState) {
case StageDisplayState.FULL_SCREEN:
/* If already in full screen mode, switch to normal mode. */
Application.application.stage.displayState = StageDisplayState.NORMAL;
break;
default:
/* If not in full screen mode, switch to full screen mode. */
trace("NORMAL"); //This is traced, but nothing happens.
Application.application.stage.displayState = StageDisplayState.FULL_SCREEN;
break;
}
} catch (err:SecurityError) {
// ignore
}
}
]]>
</mx:Script>
<mx:Button label="FullScreen" click="toggleFullScreen()" />
</mx:Application>
And this is my HTMLobject:
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="FullScreen" width="300" height="200"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="FullScreen.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<embed src="FullScreen.swf" quality="high" bgcolor="#869ca7"
width="300" height="200" name="FullScreen" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
allowFullScreen="true"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</noscript>
The only thing I've done is this line: <paramname="allowFullScreen"value="true"/> and allowFullScreen="true"
It don't work, anyone who can help me?
Thank you