<?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>Flash gotchas</title>
	<atom:link href="http://www.puckish.co.uk/gotchas/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.puckish.co.uk/gotchas</link>
	<description>Flash development time-wasters</description>
	<lastBuildDate>Fri, 02 Oct 2009 09:47:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>BitmapData draw() doesn&#8217;t work</title>
		<link>http://www.puckish.co.uk/gotchas/?p=32</link>
		<comments>http://www.puckish.co.uk/gotchas/?p=32#comments</comments>
		<pubDate>Fri, 02 Oct 2009 09:47:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.puckish.co.uk/gotchas/?p=32</guid>
		<description><![CDATA[I was trying to draw a MovieClip into a BitmapData object and it just wasn&#8217;t working. I turned on warning messages in FlashTracer and saw that there was a Security Violation. It turns out that a streaming FLV that played at the start of my movie wasn&#8217;t being removed, and there&#8217;s a security feature not [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to draw a MovieClip into a BitmapData object and it just wasn&#8217;t working. I turned on warning messages in FlashTracer and saw that there was a Security Violation. It turns out that a streaming FLV that played at the start of my movie wasn&#8217;t being removed, and there&#8217;s a security feature not to allow a screen grab of a streamed FLV.  Once I removed the FLV, parent clip, and closed the NetStream and NetConnection, the grab worked fne. Not sure which part of the tidying up was the fix.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puckish.co.uk/gotchas/?feed=rss2&amp;p=32</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FLVs don&#8217;t play</title>
		<link>http://www.puckish.co.uk/gotchas/?p=29</link>
		<comments>http://www.puckish.co.uk/gotchas/?p=29#comments</comments>
		<pubDate>Wed, 23 Sep 2009 15:56:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.puckish.co.uk/gotchas/?p=29</guid>
		<description><![CDATA[Spent ages trying to attach an FLV to a Video object &#8211; it just wouldn&#8217;t play, or would flicker onto the screen.
Turned out to be exactly the same problem as for sound &#8211; if you try and attach an FLV to a Video object, the associated NetStream and NetConnection objects will be garbage collected, unless [...]]]></description>
			<content:encoded><![CDATA[<p>Spent ages trying to attach an FLV to a Video object &#8211; it just wouldn&#8217;t play, or would flicker onto the screen.</p>
<p>Turned out to be exactly the same problem as for <a href="?p=5">sound</a> &#8211; if you try and attach an FLV to a Video object, the associated NetStream and NetConnection objects will be garbage collected, unless a reference to them exists in an object which persists.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puckish.co.uk/gotchas/?feed=rss2&amp;p=29</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Warning: Stack overflow</title>
		<link>http://www.puckish.co.uk/gotchas/?p=24</link>
		<comments>http://www.puckish.co.uk/gotchas/?p=24#comments</comments>
		<pubDate>Wed, 19 Aug 2009 16:06:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.puckish.co.uk/gotchas/?p=24</guid>
		<description><![CDATA[Spent half a day trying to identify the cause of this, in an AS2 project.
A stupid recursion problem caused by something similar to the following:
function getResult() : Boolean {
trace(getResult():&#8221; + getResult());
return value;
}
The Flash player just used to hang on error on problems like this, but now it fails silently (or with a Stack Overflow warning [...]]]></description>
			<content:encoded><![CDATA[<p>Spent half a day trying to identify the cause of this, in an AS2 project.</p>
<p>A stupid recursion problem caused by something similar to the following:<br />
function getResult() : Boolean {<br />
trace(getResult():&#8221; + getResult());<br />
return value;<br />
}</p>
<p>The Flash player just used to hang on error on problems like this, but now it fails silently (or with a Stack Overflow warning in the debug player) which is good for the user but bad for debugging! Compounded by the problem that the bug was in a trace statement,  which are usually transparent to my seeking eye.</p>
<p>I was of course cursing that I&#8217;d found a problem with the Flash Player, when Rule #1 is 99.999999999% of the time it&#8217;s your own stupid fault.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puckish.co.uk/gotchas/?feed=rss2&amp;p=24</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Masks</title>
		<link>http://www.puckish.co.uk/gotchas/?p=23</link>
		<comments>http://www.puckish.co.uk/gotchas/?p=23#comments</comments>
		<pubDate>Mon, 29 Jun 2009 15:45:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.puckish.co.uk/gotchas/?p=23</guid>
		<description><![CDATA[Sketchy details at present, but having keyframes in a mask layer seem to cause any masked movie clips to re-initialise. Solution at the moment is to move all the keyframes into a single layer movieclip and put that in the mask layer&#8230;.
]]></description>
			<content:encoded><![CDATA[<p>Sketchy details at present, but having keyframes in a mask layer seem to cause any masked movie clips to re-initialise. Solution at the moment is to move all the keyframes into a single layer movieclip and put that in the mask layer&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puckish.co.uk/gotchas/?feed=rss2&amp;p=23</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Runtime font swapping</title>
		<link>http://www.puckish.co.uk/gotchas/?p=11</link>
		<comments>http://www.puckish.co.uk/gotchas/?p=11#comments</comments>
		<pubDate>Thu, 18 Jun 2009 09:51:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.puckish.co.uk/gotchas/?p=11</guid>
		<description><![CDATA[Based on Ivan Dembicki&#8217;s work at http://www.sharedfonts.com/eng/index.html
For fonts, you need two SWFs
FONTID-lib.swf
- a textfield which embeds all glyphs needed, with bold/italic as necessary, inside a movieclip which is exported for runtime sharing. movieclip has script which registers the textformat of the field with a shared &#8220;font manager&#8221; object
FONTID.swf
- a practically empty movie which contains the [...]]]></description>
			<content:encoded><![CDATA[<p>Based on Ivan Dembicki&#8217;s work at <a href="http://www.sharedfonts.com/eng/index.html" target="_blank">http://www.sharedfonts.com/eng/index.html</a></p>
<p>For fonts, you need two SWFs<br />
FONTID-lib.swf<br />
- a textfield which embeds all glyphs needed, with bold/italic as necessary, inside a movieclip which is exported for runtime sharing. movieclip has script which registers the textformat of the field with a shared &#8220;font manager&#8221; object<br />
FONTID.swf<br />
- a practically empty movie which contains the imported movieclip from FONTID-lib.swf</p>
<p>A shared font manager which registers textformats against an identifier. You can then use the same font manager to use these textformats for any textfield. Copy font, bold and italic properties to a  new TextFormat object, so colour and size are ignored.</p>
<p>A loading routine to load the FONTID.swfs. The point of the excercise is that you can load these programmatically so you can use one font for English text and a different font for Russian text, while keeping the same base movie.</p>
<p>You seem to need both FONTID-lib.swf and FONTID.swf &#8211; you can&#8217;t just load the FONTID-lib.swf</p>
<p>I <em>think</em> the export URL in FONTID-lib.swf is not important (it doesn&#8217;t seem not be written into the SWF?).</p>
<p>The export URL in FONTID.swf is important and is relative to the base URL of the overall parent movie. Therefore these FONTID.swf files are not portable between different site structures. You can use e.g. swfmill and ANT to create different versions of the FONTID.swf quickly per deployment environment.</p>
<p>This is something I&#8217;m using for an AS2 project &#8211; better solutions may exist for AS3 (or indeed for AS2&#8230;.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puckish.co.uk/gotchas/?feed=rss2&amp;p=11</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Skewed text fields</title>
		<link>http://www.puckish.co.uk/gotchas/?p=10</link>
		<comments>http://www.puckish.co.uk/gotchas/?p=10#comments</comments>
		<pubDate>Tue, 10 Jul 2007 16:32:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[skew]]></category>
		<category><![CDATA[text fields]]></category>

		<guid isPermaLink="false">http://www.puckish.co.uk/gotchas/?p=10</guid>
		<description><![CDATA[A couple of oddities about skewed dynamic text fields in Flash 8- they won&#8217;t render with the &#8220;Anti-alias for readability&#8221; option- they don&#8217;t appear to render if the bold or italic font option is set
]]></description>
			<content:encoded><![CDATA[<p>A couple of oddities about skewed dynamic text fields in Flash 8<br />- they won&#8217;t render with the &#8220;Anti-alias for readability&#8221; option<br />- they don&#8217;t appear to render if the bold or italic font option is set</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puckish.co.uk/gotchas/?feed=rss2&amp;p=10</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Math.floor() problem</title>
		<link>http://www.puckish.co.uk/gotchas/?p=9</link>
		<comments>http://www.puckish.co.uk/gotchas/?p=9#comments</comments>
		<pubDate>Wed, 13 Jun 2007 15:24:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[float]]></category>
		<category><![CDATA[precision]]></category>
		<category><![CDATA[round]]></category>

		<guid isPermaLink="false">http://www.puckish.co.uk/gotchas/?p=9</guid>
		<description><![CDATA[Spent ages yesterday struggling with Math.floor() giving me unexpected results &#8211; Math.floor(1) was coming at as 0, Math.floor(2) was coming out as 1.
The problem arose when testing out a routine for getting the minimum number of coins to make up a value. Numbers that were tracing to the output window as integers were not being [...]]]></description>
			<content:encoded><![CDATA[<p>Spent ages yesterday struggling with Math.floor() giving me unexpected results &#8211; Math.floor(1) was coming at as 0, Math.floor(2) was coming out as 1.</p>
<p>The problem arose when testing out a routine for getting the minimum number of coins to make up a value. Numbers that were tracing to the output window as integers were not being processed by Math.floor as expected. My guess is that these numbers aren&#8217;t quite the integers they claim to be and have a tiny discrepancy (e.g .99999999999999999 instead of 1) which is why they are flooring in an unexpected way. I&#8217;m sure I&#8217;ve read something about this, and this problem has a name, but I&#8217;ll be jiggered if I can find it.</p>
<p>The code below hopefully demonstrates the problem. As indicated, I got rid of the small difference by multiplying the number up, rounding it and then dividing it back down.</p>
<p><code><br />var a:Number = 0.6 - 0.5; //should equal 0.1</p>
<p>//uncomment the line below to get rid of the tiny difference<br />//a = Math.round(a * 10) / 10;</p>
<p>var c:Number = a / .1; // 0.1 / 0.1 should equal 1</p>
<p>trace(Math.floor(c)); //should be 1, but is 0<br /></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.puckish.co.uk/gotchas/?feed=rss2&amp;p=9</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>removeMovieClip() not working</title>
		<link>http://www.puckish.co.uk/gotchas/?p=8</link>
		<comments>http://www.puckish.co.uk/gotchas/?p=8#comments</comments>
		<pubDate>Thu, 07 Jun 2007 17:19:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.puckish.co.uk/gotchas/?p=8</guid>
		<description><![CDATA[Haven&#8217;t got a decent workaround for this yet. I&#8217;m having problems removing a movieclip and attaching one within a single frame refresh.The old clip is disappearing but the new one isn&#8217;t being attached. There is still a reference hanging around, and whatever I do to it, it won&#8217;t disappear. This may be due to the [...]]]></description>
			<content:encoded><![CDATA[<p>Haven&#8217;t got a decent workaround for this yet. I&#8217;m having problems removing a movieclip and attaching one within a single frame refresh.<br />The old clip is disappearing but the new one isn&#8217;t being attached. There is still a reference hanging around, and whatever I do to it, it won&#8217;t disappear. This may be due to the fact I&#8217;m trying to attach the same symbol with the same instance name at the same depth, but I haven&#8217;t got the time to do a simple test.<br />Workaround at the moment is to do it after an interval of 0, but that is obviously nasty&#8230;..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puckish.co.uk/gotchas/?feed=rss2&amp;p=8</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The linkage identifier x was already assigned to the symbol x, and cannot be assigned</title>
		<link>http://www.puckish.co.uk/gotchas/?p=7</link>
		<comments>http://www.puckish.co.uk/gotchas/?p=7#comments</comments>
		<pubDate>Wed, 06 Jun 2007 18:46:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[linkage]]></category>
		<category><![CDATA[symbol]]></category>

		<guid isPermaLink="false">http://www.puckish.co.uk/gotchas/?p=7</guid>
		<description><![CDATA[Came across this error message last week when compiling in the Flash IDE
&#8220;The linkage identifier &#8216;BottomRightBetButtonSymbol&#8217; was already assigned to the symbol &#8216;BottomRightBetButtonSymbol&#8217;, and cannot be assigned&#8221;
You&#8217;d think I had more than one item in the library with the same linkage ID, but it was in fact caused by a MovieClip symbol with said ID [...]]]></description>
			<content:encoded><![CDATA[<p>Came across this error message last week when compiling in the Flash IDE</p>
<p>&#8220;The linkage identifier &#8216;BottomRightBetButtonSymbol&#8217; was already assigned to the symbol &#8216;BottomRightBetButtonSymbol&#8217;, and cannot be assigned&#8221;</p>
<p>You&#8217;d think I had more than one item in the library with the same linkage ID, but it was in fact caused by a MovieClip symbol with said ID being used as a movieclip instance in one place in the movie and as a button instance somewhere else (an unused frame). Thanks to user &#8220;marleeffh&#8221; for posting about it <a href="http://flashmove.com/forum/showthread.php?t=24729">here</a>. Fair enough, this was bad authoring on my part, but the error message was a bit of a red herring.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puckish.co.uk/gotchas/?feed=rss2&amp;p=7</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MTASC : Fatal error: exception IO.Bits_error</title>
		<link>http://www.puckish.co.uk/gotchas/?p=6</link>
		<comments>http://www.puckish.co.uk/gotchas/?p=6#comments</comments>
		<pubDate>Wed, 06 Jun 2007 16:57:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[MTASC]]></category>

		<guid isPermaLink="false">http://www.puckish.co.uk/gotchas/?p=6</guid>
		<description><![CDATA[I got this today when compiling an FLA into which I&#8217;d dropped some new assets. After much head scratching, it turns out that the problem was a movieclip which had a filter applied, wrapped in a Button symbol. I got around this by turning the button into a MovieClip symbol (with _up, _over labels, etc). [...]]]></description>
			<content:encoded><![CDATA[<p>I got this today when compiling an FLA into which I&#8217;d dropped some new assets. After much head scratching, it turns out that the problem was a movieclip which had a filter applied, wrapped in a Button symbol. I got around this by turning the button into a MovieClip symbol (with _up, _over labels, etc). There are other things that cause this. I narrowed down the problem by pasting the new assets individually, and then guiding the layers of the new symbols out one by one.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puckish.co.uk/gotchas/?feed=rss2&amp;p=6</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
