<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Scott Rockers&#039; Blog &#187; Fullscreen</title>
	<atom:link href="http://scottrockers.com/blog/tag/fullscreen/feed" rel="self" type="application/rss+xml" />
	<link>http://scottrockers.com/blog</link>
	<description>Website Designer and Developer, Flash, Wordpress, jQuery, and Other Scripts</description>
	<lastBuildDate>Mon, 22 Aug 2011 21:48:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Actionscript 3 Fix for the Flash Fullscreen Problem</title>
		<link>http://scottrockers.com/blog/resources/flash-information/actionscript-3-fix-for-the-flash-fullscreen-problem</link>
		<comments>http://scottrockers.com/blog/resources/flash-information/actionscript-3-fix-for-the-flash-fullscreen-problem#comments</comments>
		<pubDate>Tue, 15 Dec 2009 15:03:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Information]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Fix]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Fullscreen]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=783</guid>
		<description><![CDATA[I have come across an error while working with Flash Fullscreen. The problem occurs when you have certain publish settings. The publish setting are in the html tab -&#62; Window Mode -&#62; Transparent Windowless. So the SWF file is basically transparent like a PNG image. It has trouble knowing where the stage is on this [...]]]></description>
			<content:encoded><![CDATA[<p>I have come across an error while working with Flash Fullscreen. The problem occurs when you have certain publish settings. The publish setting are in the html tab -&gt; Window Mode -&gt; Transparent Windowless. So the SWF file is basically transparent like a PNG image. It has trouble knowing where the stage is on this setting. So I came up with  a work around or fix that takes care of this. To fix this you have to create a background movieclip that resizes to the stage size that is hidden as well, so its alpha is zero, so that Flash recoginzes that your mouse is still over the swf file, I know its weird but this works.</p>
<p>So add a movieclip to the stage that is the same size of the stage, but make the color&#8217;s alpha zero. Make sure the instance name is &#8220;bg&#8221; then in the actionscript add this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;">    <span style="color: #009900; font-style: italic;">//import library files</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">StageAlign</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">StageScaleMode</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #009900; font-style: italic;">//reset the background movieclip function</span>
    resetBGsize<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #009900; font-style: italic;">//set the stage scalemode and alignment to no scale and top left</span>
    <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleMode</span> = <span style="color: #004993;">StageScaleMode</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">NO_SCALE</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">align</span> = <span style="color: #004993;">StageAlign</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TOP_LEFT</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #009900; font-style: italic;">// add an event listener to the stage for when it is resized</span>
    <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">RESIZE</span><span style="color: #000066; font-weight: bold;">,</span> onResizeStage<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #009900; font-style: italic;">//onresizestage function for the event listener, calls resetBGsize</span>
    <span style="color: #339966; font-weight: bold;">function</span> onResizeStage<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
       resetBGsize<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #009900; font-style: italic;">//resetbgsize function resizes the background movieclip and centers it</span>
    <span style="color: #339966; font-weight: bold;">function</span> resetBGsize<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
       bg<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span> = <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageWidth</span><span style="color: #000066; font-weight: bold;">;</span>
       bg<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">height</span> = <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageHeight</span><span style="color: #000066; font-weight: bold;">;</span>
       bg<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageWidth</span> <span style="color: #009966; font-style: italic;">/ 2 - bg.width /</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span>
       bg<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageHeight</span> <span style="color: #009966; font-style: italic;">/ 2 - bg.height /</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Hope this helps someone out.</p>
<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/flash-information/actionscript-3-fix-for-the-flash-fullscreen-problem/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

