/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!-- HTML --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> var flashvars = {}; var params = {}; params.allowfullscreen = "true"; var attributes = {}; swfobject.embedSWF("untitled.swf", "myAlternativeContent", "800", "600", "9.0.0", false, flashvars, params, attributes); </script> </head> <body> <div id="myAlternativeContent"> <a href="http://www.adobe.com/go/getflashplayer"> <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> </a> </div> </body> </html> //AC3: import flash.display.StageDisplayState; function goFullScreen():void{ if (stage.displayState == StageDisplayState.NORMAL){ stage.displayState=StageDisplayState.FULL_SCREEN; } else { stage.displayState=StageDisplayState.NORMAL; } } stage.addEventListener(MouseEvent.CLICK, _handleClick) function _handleClick(event:MouseEvent):void{ goFullScreen(); }