<?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; Fix</title>
	<atom:link href="http://scottrockers.com/blog/tag/fix/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>WordPress List Category Posts without Breaking Sidebar</title>
		<link>http://scottrockers.com/blog/resources/simple-code-tricks/wordpress-list-category-posts-without-breaking-sidebar</link>
		<comments>http://scottrockers.com/blog/resources/simple-code-tricks/wordpress-list-category-posts-without-breaking-sidebar#comments</comments>
		<pubDate>Wed, 20 Jul 2011 19:17:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Simple Code Tricks]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Fix]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[query_posts]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=1240</guid>
		<description><![CDATA[As I was creating a page template for wordpress, I wanted to list posts from a specific category on a page when I ran into a interesting problem, the query_posts function I was using was causing breaks in the execution of conditional tags like is_page(&#8217;25&#8242;) in the sidebar template.  I looked around on the web [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://scottrockers.com/blog/wp-content/uploads/2011/07/query_post-image.jpg" alt="query_post codex" title="query_post codex" width="590" height="300" class="aligncenter size-full wp-image-1244" /><br />
As I was creating a page template for wordpress, I wanted to list posts from a specific category on a page when I ran into a interesting problem, the query_posts function I was using was causing breaks in the execution of conditional tags like is_page(&#8217;25&#8242;) in the sidebar template.  I looked around on the web for a while before finally finding the solution that worked for me. So I am rewriting the solution here for reference and so anyone else may find it easier.</p>
<p>Here is how you list posts from a particular category in a wordpress page template, right before the &#8220;while (have_posts()) : the_post(); &#8221; call add:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> query_posts<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category_name=name&amp;showposts=100'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">/*  change name to the name of the category posts you want to display   */</span>  <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>The reason the wordpress function query_posts() breaks the sidebar template is because its not a simple database query collecting posts from a specific category, but its resetting the query object as a whole to reflect a normal category query. </p>
<p>So to fix the sidebar template you have to go with creating a new query object through WP_Query() in your page template. So here is the before and after of the loop in a page template.</p>
<p><strong>Page Template Loop BEFORE:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> query_posts<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category_name=name&amp;showposts=100'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
       &lt;!-- do stuff ... --&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>Page Template Loop AFTER:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$cat_posts</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Query<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category_name=name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cat_posts</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
         <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cat_posts</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$cat_posts</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">the_post</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
                 &lt;!-- do stuff ... --&gt;
         <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</pre>
<p>Hope that helps someone, cya.</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/simple-code-tricks/wordpress-list-category-posts-without-breaking-sidebar/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading Multiple XML Files in Flash</title>
		<link>http://scottrockers.com/blog/resources/simple-code-tricks/loading-multiple-xml-files-in-flash</link>
		<comments>http://scottrockers.com/blog/resources/simple-code-tricks/loading-multiple-xml-files-in-flash#comments</comments>
		<pubDate>Wed, 21 Apr 2010 20:01:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Simple Code Tricks]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Fix]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=1044</guid>
		<description><![CDATA[While working on my second version of RocFolio, I came across a few errors while trying to load multiple xml files in Flash AS3. When loading the files sometimes Flash would randomly put additional characters at the end of my xml file giving me parsing errors. So I had to figure out a way to [...]]]></description>
			<content:encoded><![CDATA[<p>While working on my second version of <a href="http://activeden.net/item/rocfolio-flash-and-wordpress-portfolio-template/75270?ref=scottrockers">RocFolio</a>, I came across a few errors while trying to load multiple xml files in Flash AS3. When loading the files sometimes Flash would randomly put additional characters at the end of my xml file giving me parsing errors. So I had to figure out a way to cut those out, and I&#8217;ll try to explain real quick what I did. </p>
<p>So to load your XML you have to create your load and request variables and then you should create a few event listeners for progress and complete events, like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">loader</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">URLLoader</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLLoader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> requestURL<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">URLRequest</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span>xmlfilename<span style="color: #000066; font-weight: bold;">.</span>xml<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//create progress and complete event listeners for the loader, and load the urlrequest</span>
<span style="color: #004993;">loader</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;">ProgressEvent</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">PROGRESS</span><span style="color: #000066; font-weight: bold;">,</span> getBytesLoop<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">loader</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;">COMPLETE</span><span style="color: #000066; font-weight: bold;">,</span> loadXML<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<p>Now in your loadXML function all you have to do is figure out where the xml file actually ends, and then index that spot and then cut the rest of the string out with the substring() command. Here is how you do that.</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
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">//function loadxml loads the xml and handles assigning to places</span>
<span style="color: #339966; font-weight: bold;">function</span> loadXML<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>
&nbsp;
	<span style="color: #6699cc; font-weight: bold;">var</span> dataString<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">target</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> finalString<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> endofString<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
        <span style="color: #009900; font-style: italic;">//find out where the end of the xml file is, however your set it up it should be the last closing tag, this one is &lt;/settings&gt;</span>
	endofString = dataString<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;&lt;/settings&gt;&quot;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">//cut out the good part of the xml using substring, then use 0 as your starting point to where you got your endOfString</span>
        <span style="color: #009900; font-style: italic;">//make sure to add whatever amount you need to be at the end of the your last closing tag, &lt;/settings&gt; has 11 characters in it so +11</span>
	finalString = dataString<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">substring</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> endofString<span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">11</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">//then assign the finalstring to your XML variable</span>
	<span style="color: #0033ff; font-weight: bold;">try</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #6699cc; font-weight: bold;">var</span> theXML<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">XML</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">XML</span><span style="color: #000000;">&#40;</span>finalString<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">catch</span> <span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">TypeError</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #009900; font-style: italic;">//loader.load(requestURL);</span>
		<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;A TypeError has occurred : <span style="">\r</span><span style="">\t</span>&quot;</span> <span style="color: #000066; font-weight: bold;">+</span> e<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;">//then go on with setting up your XMLLists so you can access the data how you want</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>So hopefully this helps those out there that are getting weird parsing errors when trying to load multiple XML files. I know I tried finding the solution out on the web and couldn&#8217;t so that&#8217;s why I wrote this, if it helps you out please leave a comment.</p>
<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/simple-code-tricks/loading-multiple-xml-files-in-flash/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Workaround Solution to Flash Error #2044, Unhandled SecurityError, and Error #2048, Security Sandbox Violation</title>
		<link>http://scottrockers.com/blog/resources/flash-information/workaround-solution-to-flash-error-2044-unhandled-securityerror-and-error-2048-security-sandbox-violation</link>
		<comments>http://scottrockers.com/blog/resources/flash-information/workaround-solution-to-flash-error-2044-unhandled-securityerror-and-error-2048-security-sandbox-violation#comments</comments>
		<pubDate>Fri, 26 Feb 2010 18:06:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Information]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Fix]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[news ticker]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=946</guid>
		<description><![CDATA[I sell Flash components on ActiveDen, and while working with a client on my Flash News Ticker we ran into the infamous &#8220;Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation&#8221; when trying to gather information from an external RSS Feed. This error occurs when your flash file is trying to get data from a [...]]]></description>
			<content:encoded><![CDATA[<p>I sell Flash components on <a href="http://www.activeden.net?ref=scottrockers">ActiveDen</a>, and while working with a client on my <a href="http://activeden.net/item/news-feed-ticker/71605?Ref=scottrockers">Flash News Ticker</a> we ran into the infamous &#8220;Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation&#8221; when trying to gather information from an external RSS Feed.</p>
<p>This error occurs when your flash file is trying to get data from a different domain and it can&#8217;t because of security reasons on their server. The usual fix for this is to create a crossdomain.xml file that allows access from other websites to use the data on yours, but the problem with that is if you don&#8217;t host that site you want the data from then how could you create or update the crossdomain.xml file on their server.</p>
<p>I did find a work around for it though! Not sure if its &#8220;the right way to do it&#8221; but it does work.</p>
<p>Here is the solution, I copy that url of the feed I want the data from, go to my <a href="http://feedburner.google.com">feedburner</a> account and create a feedburner feed of the same feed. If you don&#8217;t know what feedburner is then you should definatly check it out. You basically can sign up for feedburner if you have a google account already. Anyway, after you get the feedburner feed of the data you want you can view it. Then if you want to see the xml version of the Feedburner Feed, you can just add  &#8220;?format=xml&#8221; onto the end of the url they give you, and this is the normal RSS 2.0 feed that we are wanting.</p>
<p>This is the data you want, because its not on the security problematic website. The next thing I ran into was getting the images to display in the news ticker as well. I kept getting the same error but if I dismissed the errors then they still worked. So I used a try-catch clause to get the error and throw it if it gets one. Here is an example of that code:</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
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #339966; font-weight: bold;">function</span> imageLoaded<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>
	<span style="color: #0033ff; font-weight: bold;">try</span> <span style="color: #000000;">&#123;</span>
                <span style="color: #009900; font-style: italic;">//make the image into a bitmap and smooth it</span>
		<span style="color: #6699cc; font-weight: bold;">var</span> image<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Bitmap</span> = e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">target</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">content</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Bitmap</span><span style="color: #000066; font-weight: bold;">;</span>
		image<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">smoothing</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #009900; font-style: italic;">//resizes the image</span>
		e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">target</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">content</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">55</span><span style="color: #000066; font-weight: bold;">;</span>
		e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">target</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">content</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">height</span> = <span style="color: #000000; font-weight:bold;">35</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">catch</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">error</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Error</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Error catch: &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">error</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>This is called from an event listener when loading it in using a loader object, that looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">imageLoader<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">contentLoaderInfo</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;">INIT</span><span style="color: #000066; font-weight: bold;">,</span> imageLoaded<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>So basically it worked after this, and the images even showed up without showing the error. The only problem is that the images don&#8217;t get resized because they can&#8217;t be loaded into the swf memory. Here are the examples: the one on the left is the broken example, it can&#8217;t get the information it wants to so it just keeps trying to load it. The example on the right shows the fix. (You have to view them in IE so the error warnings appear, another thing to hate about IE. :/ )</p>
<table width="100%" border="0">
<tr>
<th scope="col"><a href="http://scottrockers.com/blog/wp-content/uploads/2010/02/newstickerex1.html"><img src="http://scottrockers.com/blog/wp-content/uploads/2010/02/2044error-300x152.jpg" alt="" title="2044error" width="300" height="152" class="aligncenter size-medium wp-image-947" style="border:1px solid white;" /></a></th>
<th scope="col"><a href="http://scottrockers.com/blog/wp-content/uploads/2010/02/newstickerex2.html"><img src="http://scottrockers.com/blog/wp-content/uploads/2010/02/no2044error-300x152.jpg" alt="" title="no2044error" width="300" height="152" class="aligncenter size-medium wp-image-948" style="border:1px solid white;"/></a></th>
</tr>
</table>
<p>Any thoughts or comments are encouraged,<br />
Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/flash-information/workaround-solution-to-flash-error-2044-unhandled-securityerror-and-error-2048-security-sandbox-violation/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<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>

