<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: attachMovie doesn&#8217;t return a value&#8230; in the Twilight Zone	</title>
	<atom:link href="https://jessewarden.com/2004/01/attachmovie-doesnt-return-a-value-in-the-twilight-zone.html/feed" rel="self" type="application/rss+xml" />
	<link>https://jessewarden.com/2004/01/attachmovie-doesnt-return-a-value-in-the-twilight-zone.html</link>
	<description>Software &#124; Fitness &#124; Gaming</description>
	<lastBuildDate>Mon, 05 Jan 2004 22:28:25 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: ptrdo		</title>
		<link>https://jessewarden.com/2004/01/attachmovie-doesnt-return-a-value-in-the-twilight-zone.html/comment-page-1#comment-1180</link>

		<dc:creator><![CDATA[ptrdo]]></dc:creator>
		<pubDate>Mon, 05 Jan 2004 22:28:25 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=384#comment-1180</guid>

					<description><![CDATA[&quot;this&quot; is not required for scope, but there&#039;s no avoiding its use sometimes when you need to attach a timeline method.

AS1 or AS2, the code always precedes the stage draw, so if you think about it, that attached movie isn&#039;t really there until it is loaded and initialized.

I&#039;ve had a similar dilemma in the past and resolved it by nesting all the execution code in an onEnterFrame event with a conditional stopgap:

var mc = attachMovie(&quot;box&quot;,&quot;my_mc&quot;,1);
	
mc.onEnterFrame = function() {
		
 if ( !init ) {
			
   this._rotation = 45;
   init = true;
			
 } else {
			
   this.onEnterFrame = null;
 }
};
]]></description>
			<content:encoded><![CDATA[<p>&#8220;this&#8221; is not required for scope, but there&#8217;s no avoiding its use sometimes when you need to attach a timeline method.</p>
<p>AS1 or AS2, the code always precedes the stage draw, so if you think about it, that attached movie isn&#8217;t really there until it is loaded and initialized.</p>
<p>I&#8217;ve had a similar dilemma in the past and resolved it by nesting all the execution code in an onEnterFrame event with a conditional stopgap:</p>
<p>var mc = attachMovie(&#8220;box&#8221;,&#8221;my_mc&#8221;,1);</p>
<p>mc.onEnterFrame = function() {</p>
<p> if ( !init ) {</p>
<p>   this._rotation = 45;<br />
   init = true;</p>
<p> } else {</p>
<p>   this.onEnterFrame = null;<br />
 }<br />
};</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: JesterXL		</title>
		<link>https://jessewarden.com/2004/01/attachmovie-doesnt-return-a-value-in-the-twilight-zone.html/comment-page-1#comment-1179</link>

		<dc:creator><![CDATA[JesterXL]]></dc:creator>
		<pubDate>Mon, 05 Jan 2004 21:57:22 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=384#comment-1179</guid>

					<description><![CDATA[The problem with that is if you expect to do this:

attachMovie(&quot;MyComponent&quot;, &quot;my_mc&quot;, 0);
my_mc.play();

It won&#039;t work... the onLoad happens after the above code; a frame after.  This causes problems if your expecting to be able to go forward a frame.

...however, IF you know the onLoad executes a frame after, and your methods that cause it to change state can handle an onEnterFrame + execute + kill onEnterFrame, then onLoad works great.

...still, I just wanna know why.  I personally think it&#039;s some sort of scopage issue in AS2 that I&#039;m not understanding.  One thing I liked about AS2 was not using &quot;this&quot; everywhere, so I just assumed stop would work too, but obviously not.]]></description>
			<content:encoded><![CDATA[<p>The problem with that is if you expect to do this:</p>
<p>attachMovie(&#8220;MyComponent&#8221;, &#8220;my_mc&#8221;, 0);<br />
my_mc.play();</p>
<p>It won&#8217;t work&#8230; the onLoad happens after the above code; a frame after.  This causes problems if your expecting to be able to go forward a frame.</p>
<p>&#8230;however, IF you know the onLoad executes a frame after, and your methods that cause it to change state can handle an onEnterFrame + execute + kill onEnterFrame, then onLoad works great.</p>
<p>&#8230;still, I just wanna know why.  I personally think it&#8217;s some sort of scopage issue in AS2 that I&#8217;m not understanding.  One thing I liked about AS2 was not using &#8220;this&#8221; everywhere, so I just assumed stop would work too, but obviously not.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ptrdo		</title>
		<link>https://jessewarden.com/2004/01/attachmovie-doesnt-return-a-value-in-the-twilight-zone.html/comment-page-1#comment-1178</link>

		<dc:creator><![CDATA[ptrdo]]></dc:creator>
		<pubDate>Mon, 05 Jan 2004 21:52:46 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=384#comment-1178</guid>

					<description><![CDATA[IMHO this has something to do with the stage draw. A stop() is a method of the timeline and constructor code precedes the timeline, so it makes sense that this cause a hang. How about addingto your construction: this.onload = function(){stop();}]]></description>
			<content:encoded><![CDATA[<p>IMHO this has something to do with the stage draw. A stop() is a method of the timeline and constructor code precedes the timeline, so it makes sense that this cause a hang. How about addingto your construction: this.onload = function(){stop();}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: cedric		</title>
		<link>https://jessewarden.com/2004/01/attachmovie-doesnt-return-a-value-in-the-twilight-zone.html/comment-page-1#comment-1177</link>

		<dc:creator><![CDATA[cedric]]></dc:creator>
		<pubDate>Mon, 05 Jan 2004 18:39:10 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=384#comment-1177</guid>

					<description><![CDATA[no you aren&#039;t..... I was wondering in an open-way... 

* hmmmm, ..., a FLASH , hmmm, a FLASH pattern *

which wouldn&#039;t be a pattern, just a Flattern !

;)]]></description>
			<content:encoded><![CDATA[<p>no you aren&#8217;t&#8230;.. I was wondering in an open-way&#8230; </p>
<p>* hmmmm, &#8230;, a FLASH , hmmm, a FLASH pattern *</p>
<p>which wouldn&#8217;t be a pattern, just a Flattern !</p>
<p>;)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: JesterXL		</title>
		<link>https://jessewarden.com/2004/01/attachmovie-doesnt-return-a-value-in-the-twilight-zone.html/comment-page-1#comment-1176</link>

		<dc:creator><![CDATA[JesterXL]]></dc:creator>
		<pubDate>Mon, 05 Jan 2004 18:14:35 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=384#comment-1176</guid>

					<description><![CDATA[Maybe your right about the top down/bottom up... didn&#039;t check that.  Hrm...

Naw, I don&#039;t think your being aggressive.  Hehe, Flash practice is unique in it&#039;s own right; I meant strictly the coding practices I espouse, not Flash itself.  I agree, it is a miracle it works sometimes.

...depends on the pattern.  The boyz I used to work with upstairs are all about patterns; so far, I get away with minimal MVC usage as far as coding goes; UI wise, I&#039;m not sure.  Every product it&#039;s different, but I may be mis-interpreting your question.]]></description>
			<content:encoded><![CDATA[<p>Maybe your right about the top down/bottom up&#8230; didn&#8217;t check that.  Hrm&#8230;</p>
<p>Naw, I don&#8217;t think your being aggressive.  Hehe, Flash practice is unique in it&#8217;s own right; I meant strictly the coding practices I espouse, not Flash itself.  I agree, it is a miracle it works sometimes.</p>
<p>&#8230;depends on the pattern.  The boyz I used to work with upstairs are all about patterns; so far, I get away with minimal MVC usage as far as coding goes; UI wise, I&#8217;m not sure.  Every product it&#8217;s different, but I may be mis-interpreting your question.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
