Advanced Flash Components
Search!
Search!
Home >  Tutorials >  FLV Player (AS 3.0) Basic Skins >  Activate Full Screen Mode for...
Activate Full Screen Mode for the FLV Player
Updated: Dec 28, 2007   Views: 4621  
Description: This tutorial will show you how to change the HTML code to activate the full screen feature in the FLV Player AS3.0 Component.


HTML Code Used in this Example:

<script language="javascript">
    if (AC_FL_RunContent == 0) {
        alert("This page requires AC_RunActiveContent.js.");
    } else {
        AC_FL_RunContent(
            'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
            'width', '800',
            'height', '450',
            'src', 'sourcename',
            'quality', 'high',
            'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
            'align', 'middle',
            'play', 'true',
            'loop', 'true',
            'scale', 'showall',
            'wmode', 'window',
            'devicefont', 'false',
            'id', 'sourcename',
            'bgcolor', '#ffffff',
            'name', 'sourcename',
            'menu', 'true',
            'allowFullScreen', 'true',
            'allowScriptAccess','sameDomain',
            'movie', 'sourcename',
            'salign', ''
            ); //end AC code
    }
</script>
<noscript>
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="800" height="450" id="swfname" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="true" />
    <param name="movie" value="your.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />    <embed src="your.swf" quality="high" bgcolor="#ffffff" width="800" height="450" name="sourcename" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
</noscript>



Setting up the FLV Player and Setting the Source

To begin make sure that you have the FLV Player and your purchased installed using the extension manager, have created a new Flash ActionScript 3.0 File and have dragged an instance of the FLV Player onto the stage from the Component Panel (Window > Components).

After you have successfully added the FLV Player to your stage, you need to set the source to your FLV video.  These can be found in the component inspector (Window > Component Inspector) or parameters panel (Window > Properties > Parameters) under the property source.



Scale Mode Setting


You will also need to make sure in your component inspector window that the scalemode is set to maintain aspect ratio.

Exporting/Publishing

Now, you need publish your video into a swf. One way to do this is (File > Publish), by doing it this way you can also export a HTML document with your flash movie embedded into it.




Activate  Full Screen Mode by Changing a Few Lines in the HTML Code

When you first look at your html, you see that the allow full screen properties are false. We will need to set this to true in order for full screen to work.

<script language="javascript">
    if (AC_FL_RunContent == 0) {
        alert("This page requires AC_RunActiveContent.js.");
    } else {
        AC_FL_RunContent(
            'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
            'width', '800',
            'height', '450',
            'src', 'sourcename',
            'quality', 'high',
            'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
            'align', 'middle',
            'play', 'true',
            'loop', 'true',
            'scale', 'showall',
            'wmode', 'window',
            'devicefont', 'false',
            'id', 'sourcename',
            'bgcolor', '#ffffff',
            'name', 'sourcename',
            'menu', 'true',
            'allowFullScreen', 'true',
            'allowScriptAccess','sameDomain',
            'movie', 'sourcename',
            'salign', ''
            ); //end AC code
    }
</script>
<noscript>
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="800" height="450" id="swfname" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="true" />
    <param name="movie" value="your.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />    <embed src="your.swf" quality="high" bgcolor="#ffffff" width="800" height="450" name="sourcename" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
</noscript>



Please Note

Flash exports a JavaScript file a long with your HTML that needs to be included on your server for the above code to work. Here is an edited code if you do not wish to include the javascript.

    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="800" height="450" id="swfname" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="true" />
    <param name="movie" value="your.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />    <embed src="your.swf" quality="high" bgcolor="#ffffff" width="800" height="450" name="sourcename" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>