<?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>Blowing Through Lines &#187; Bugs</title>
	<atom:link href="http://blowingthroughlines.com/category/bugs/feed/" rel="self" type="application/rss+xml" />
	<link>http://blowingthroughlines.com</link>
	<description>Highly addictive code.</description>
	<lastBuildDate>Tue, 15 Jun 2010 18:14:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>External Interface Callbacks with Jquery</title>
		<link>http://blowingthroughlines.com/2009/09/28/bugs/external-interface-callbacks-with-jquery/</link>
		<comments>http://blowingthroughlines.com/2009/09/28/bugs/external-interface-callbacks-with-jquery/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 15:59:07 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flash AS 3.0]]></category>
		<category><![CDATA[Flex 3]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=141</guid>
		<description><![CDATA[So first off, NEVER use this most lazy of hacks to reference the flash object when calling a method in a flash file:

?View Code JAVASCRIPT1
2
3
4
// some code
function test&#40;&#41; &#123;
	flashID.ner&#40;&#34;hello&#34;&#41;; // BAAAAAAD!
&#125;

For some reason it works… Some of the time. On Safari when testing running from Flex. On my Mac.
I was being lazy and not really [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>So first off, <em><strong>NEVER</strong></em> use this most lazy of hacks to reference the flash object when calling a method in a flash file:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p141code4'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1414"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p141code4"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// some code</span>
<span style="color: #003366; font-weight: bold;">function</span> test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	flashID.<span style="color: #660066;">ner</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hello&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// BAAAAAAD!</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>For some reason it works… Some of the time. On Safari when testing running from Flex. On my Mac.</p>
<p>I was being lazy and not really thinking back to how things work in Javascript at the time, then having recently started using Jquery, I tried:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p141code5'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1415"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p141code5"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// some code</span>
<span style="color: #003366; font-weight: bold;">function</span> test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> flashMovie <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flashID'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	flashMovie.<span style="color: #660066;">ner</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hello&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// ALSO BAAAAAAD!</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Also doesn&#8217;t work, for some reason Jquery removes the methods associated with the embed tag that is written, and replaces them with only the Jquery methods. So in order for this to work the code needs to be simply:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p141code6'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1416"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p141code6"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> flashMovie <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementByID</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;flashID&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	flashMovie.<span style="color: #660066;">ner</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hello&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// FINALLY! It worked.</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>



<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2009/09/28/bugs/external-interface-callbacks-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Input Text Bug</title>
		<link>http://blowingthroughlines.com/2007/12/08/cs3/flash-input-text-bug/</link>
		<comments>http://blowingthroughlines.com/2007/12/08/cs3/flash-input-text-bug/#comments</comments>
		<pubDate>Sat, 08 Dec 2007 17:59:35 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[CS3]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/2007/12/08/cs3/flash-input-text-bug/</guid>
		<description><![CDATA[The other day I was throwing an email form together really quickly, and decided to lay it out on the stage. So added 4 input fields, for name, email, subject, and message, and used those names as the instance names. then i put some labels in them, since i was planning on doing some nice [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>The other day I was throwing an email form together really quickly, and decided to lay it out on the stage. So added 4 input fields, for <em>name</em>, <em>email</em>, <em>subject</em>, and <em>message</em>, and used those names as the instance names. then i put some labels in them, since i was planning on doing some nice ON_FOCUS text relacement. but before going much farther i needed to check to see if the alignment was right, and tested the movie.<br />
At which point I quite unexpectedly got this error:</p>
<pre>Error: Error #2078: The name property of a Timeline-placed object cannot be modified.
	at flash.display::DisplayObject/set name()
	at flash.display::Sprite/flash.display:Sprite::constructChildren()
	at flash.display::Sprite$iinit()
	at flash.display::MovieClip$iinit()</pre>
<p><br/>And I hadn&#8217;t even imported the form class I had used a dozen times before&#8230; </p>
<p><span id="more-25"></span></p>
<h3>Solution</h3>
<p>The Flash IDE has some reserved instance names stored in it that will give you immediate warnings when you try to use them (try entering <em>name txt</em>) <em>name</em> isn&#8217;t one of the reserved words, but&mdash;at least for input text fields&mdash;it should be.<br />
Seems like they could have saved users some time and frustration by reserving that word in the IDE so that it can&#8217;t be entered.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2007/12/08/cs3/flash-input-text-bug/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>E4X &amp; XMLList fails when defined in a switch statement.</title>
		<link>http://blowingthroughlines.com/2007/11/17/bugs/e4x-xmllist-fails-when-defined-in-a-switch-statement/</link>
		<comments>http://blowingthroughlines.com/2007/11/17/bugs/e4x-xmllist-fails-when-defined-in-a-switch-statement/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 01:01:58 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flash AS 3.0]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/flash-as3/nilloc/e4x-xmllist-fails-when-defined-in-a-switch-statement/</guid>
		<description><![CDATA[This one had me REALLY confused, for a good bit of time, luckily a co-worker helped be go through a rather vigorous debugging session to pinpoint the problem. Apparently if you are attempting to access a piece of a larger XML object using the new E4X capabilities and you attempt to do it with a [...]


Related posts:<ol><li><a href='http://blowingthroughlines.com/2009/09/28/bugs/external-interface-callbacks-with-jquery/' rel='bookmark' title='Permanent Link: External Interface Callbacks with Jquery'>External Interface Callbacks with Jquery</a> <small>So first off, NEVER use this most lazy of hacks...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>This one had me REALLY confused, for a good bit of time, luckily a co-worker helped be go through a rather vigorous debugging session to pinpoint the problem. Apparently if you are attempting to access a piece of a larger XML object using the new E4X capabilities and you attempt to do it with a single line of code, it will return a null object instead of the expected XMLList object it should. After looking into it further, I discovered that if you define the variable, but don&#8217;t set it&#8217;s value on the same line, then it works fine&#8230; See wonky huh?</p>
<h2>Example (Based on Adobes example documentation):</h2>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p23code14'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2314"><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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
</pre></td><td class="code" id="p23code14"><pre class="actionscript" style="font-family:monospace;">package
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> XMLListExample <span style="color: #0066CC;">extends</span> Sprite
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> books:<span style="color: #0066CC;">XML</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> XMLListExample<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		books =		<span style="color: #66cc66;">&lt;</span>books<span style="color: #66cc66;">&gt;</span>
			<span style="color: #66cc66;">&lt;</span>book publisher=<span style="color: #ff0000;">&quot;Addison-Wesley&quot;</span> <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;Design Patterns&quot;</span> <span style="color: #66cc66;">/&gt;</span>
			<span style="color: #66cc66;">&lt;</span>book publisher=<span style="color: #ff0000;">&quot;Addison-Wesley&quot;</span> <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;The Pragmatic Programmer&quot;</span> <span style="color: #66cc66;">/&gt;</span>
			<span style="color: #66cc66;">&lt;</span>book publisher=<span style="color: #ff0000;">&quot;Addison-Wesley&quot;</span> <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;Test Driven Development&quot;</span> <span style="color: #66cc66;">/&gt;</span>
			<span style="color: #66cc66;">&lt;</span>book publisher=<span style="color: #ff0000;">&quot;Addison-Wesley&quot;</span> <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;Refactoring to Patterns&quot;</span> <span style="color: #66cc66;">/&gt;</span>
			<span style="color: #66cc66;">&lt;</span>book publisher=<span style="color: #ff0000;">&quot;O'Reilly Media&quot;</span> <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;The Cathedral &amp; the Bazaar&quot;</span> <span style="color: #66cc66;">/&gt;</span>
			<span style="color: #66cc66;">&lt;</span>book publisher=<span style="color: #ff0000;">&quot;O'Reilly Media&quot;</span> <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;Unit Test Frameworks&quot;</span> <span style="color: #66cc66;">/&gt;</span>
		<span style="color: #66cc66;">&lt;/</span>books<span style="color: #66cc66;">&gt;</span>;
&nbsp;
		showBooksByPublisher<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> showBooksByPublisher<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> ner = <span style="color: #ff0000;">&quot;ren&quot;</span>;
		<span style="color: #b1b100;">switch</span><span style="color: #66cc66;">&#40;</span>ner<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;ren&quot;</span>:
			<span style="color: #808080; font-style: italic;">// the working code</span>
			<span style="color: #000000; font-weight: bold;">var</span> results:XMLList;<span style="color: #808080; font-style: italic;">// = new XMLList();</span>
			results = books.<span style="color: #006600;">book</span>.<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">@</span>publisher == <span style="color: #ff0000;">&quot;Addison-Wesley&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;results:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>+results<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// returns a the first 4 items (which contain &quot;Adison...&quot;)</span>
&nbsp;
			<span style="color: #808080; font-style: italic;">// now for the fun!!!</span>
			<span style="color: #000000; font-weight: bold;">var</span> otherResults:XMLList = books.<span style="color: #006600;">book</span>.<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">@</span>publisher == <span style="color: #ff0000;">&quot;O'Reilly Media&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;other results:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>+otherResults<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// returns null? (actually a null object)</span>
&nbsp;
			<span style="color: #808080; font-style: italic;">// just to see if oneline variable definitions work</span>
			<span style="color: #000000; font-weight: bold;">var</span> test:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">'ner'</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;test string: &quot;</span>+test<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// seeing what else is a problem to do this way</span>
			<span style="color: #000000; font-weight: bold;">var</span> objTest:<span style="color: #0066CC;">Object</span> = <span style="color: #66cc66;">&#123;</span>ner:<span style="color: #ff0000;">&quot;ren&quot;</span><span style="color: #66cc66;">&#125;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'test object: '</span>+objTest.<span style="color: #006600;">ner</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// yup works fine.</span>
			<span style="color: #808080; font-style: italic;">//</span>
			<span style="color: #000000; font-weight: bold;">var</span> xmlTest:<span style="color: #0066CC;">XML</span> = <span style="color: #66cc66;">&lt;</span>ners<span style="color: #66cc66;">&gt;</span>
			<span style="color: #66cc66;">&lt;</span>ner<span style="color: #66cc66;">&gt;</span>ren<span style="color: #66cc66;">&lt;/</span>ner<span style="color: #66cc66;">&gt;</span>
			<span style="color: #66cc66;">&lt;/</span>ners<span style="color: #66cc66;">&gt;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'test xml:<span style="color: #000099; font-weight: bold;">\n</span>'</span>+xmlTest<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// no problem here either.</span>
			<span style="color: #808080; font-style: italic;">//</span>
			<span style="color: #000000; font-weight: bold;">var</span> numTest:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">45</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'test number: '</span>+numTest<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// this is fine too.</span>
			<span style="color: #b1b100;">break</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>ner == <span style="color: #ff0000;">&quot;ren&quot;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> otherOtherResults:XMLList = books.<span style="color: #006600;">book</span>.<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">@</span>publisher == <span style="color: #ff0000;">&quot;O'Reilly Media&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;other other results:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>+otherOtherResults<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// works fine as well.</span>
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span><span style="color: #808080; font-style: italic;">// end of class</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p><a href="http://blowingthroughlines.com/wp-content/uploads/2007/11/xmllist_bug_tester.zip" title="Tester file for the XMLList Bug">Download the code.</a></p>
<p>Tell your friends, I&#8217;m letting Adobe know. And please let us know if your testing shows differently.</p>


<p>Related posts:<ol><li><a href='http://blowingthroughlines.com/2009/09/28/bugs/external-interface-callbacks-with-jquery/' rel='bookmark' title='Permanent Link: External Interface Callbacks with Jquery'>External Interface Callbacks with Jquery</a> <small>So first off, NEVER use this most lazy of hacks...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2007/11/17/bugs/e4x-xmllist-fails-when-defined-in-a-switch-statement/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
