<?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: Targeting movieclip from an AS3 class file &#8211; reply</title>
	<atom:link href="http://www.dustypixels.com/blog/2008/01/15/targeting-movieclip-from-an-as3-class-file-reply/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dustypixels.com/blog/2008/01/15/targeting-movieclip-from-an-as3-class-file-reply/</link>
	<description>Infrequent ramblings... sometimes.</description>
	<lastBuildDate>Mon, 15 Feb 2010 03:26:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: worked</title>
		<link>http://www.dustypixels.com/blog/2008/01/15/targeting-movieclip-from-an-as3-class-file-reply/comment-page-1/#comment-108327</link>
		<dc:creator>worked</dc:creator>
		<pubDate>Tue, 12 Jan 2010 18:59:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.dustypixels.com/blog/2008/01/15/targeting-movieclip-from-an-as3-class-file-reply/#comment-108327</guid>
		<description>Excellent! Thanks for the hints!  I was able to successfully create a custom event class and use it to control the main timeline.  In this case the document class was my &quot;controller&quot; class.</description>
		<content:encoded><![CDATA[<p>Excellent! Thanks for the hints!  I was able to successfully create a custom event class and use it to control the main timeline.  In this case the document class was my &#8220;controller&#8221; class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: oldskool73</title>
		<link>http://www.dustypixels.com/blog/2008/01/15/targeting-movieclip-from-an-as3-class-file-reply/comment-page-1/#comment-108325</link>
		<dc:creator>oldskool73</dc:creator>
		<pubDate>Thu, 07 Jan 2010 15:44:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.dustypixels.com/blog/2008/01/15/targeting-movieclip-from-an-as3-class-file-reply/#comment-108325</guid>
		<description>Hi &#039;worked&#039;,

this.gotoAndPlay(2) isn&#039;t going to effect the main timeline, as &#039;this&#039; will be a reference to the clicked button within that scope (or possibly the black_box, depending on your code), you could this.parent.... your way up to the root, but that&#039;s messy and easy to break.

What I&#039;d do is dispatch an event from the iconClicked function, listen for that event in the control.as or whichever class is responsible for managing the root timeline, and call gotoAndPlay from there.

HTH
A</description>
		<content:encoded><![CDATA[<p>Hi &#8216;worked&#8217;,</p>
<p>this.gotoAndPlay(2) isn&#8217;t going to effect the main timeline, as &#8216;this&#8217; will be a reference to the clicked button within that scope (or possibly the black_box, depending on your code), you could this.parent&#8230;. your way up to the root, but that&#8217;s messy and easy to break.</p>
<p>What I&#8217;d do is dispatch an event from the iconClicked function, listen for that event in the control.as or whichever class is responsible for managing the root timeline, and call gotoAndPlay from there.</p>
<p>HTH<br />
A</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: worked</title>
		<link>http://www.dustypixels.com/blog/2008/01/15/targeting-movieclip-from-an-as3-class-file-reply/comment-page-1/#comment-108324</link>
		<dc:creator>worked</dc:creator>
		<pubDate>Thu, 07 Jan 2010 15:09:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.dustypixels.com/blog/2008/01/15/targeting-movieclip-from-an-as3-class-file-reply/#comment-108324</guid>
		<description>Quick question... but what if blackbox_mc has it&#039;s own code, code that cause the timeline to gotoAndPlay another frame (from the main timeline) when clicked?  For instance, if blackBox_mc created another button mc that listened for a click event, iconClicked(e:MouseEvent).  How would i advance the main timeline to the 2nd frame when clicked?

function iconClicked(e:MouseEvent):void {
  this.gotoAndPlay(2);
}

Thanks any help is appreciated!</description>
		<content:encoded><![CDATA[<p>Quick question&#8230; but what if blackbox_mc has it&#8217;s own code, code that cause the timeline to gotoAndPlay another frame (from the main timeline) when clicked?  For instance, if blackBox_mc created another button mc that listened for a click event, iconClicked(e:MouseEvent).  How would i advance the main timeline to the 2nd frame when clicked?</p>
<p>function iconClicked(e:MouseEvent):void {<br />
  this.gotoAndPlay(2);<br />
}</p>
<p>Thanks any help is appreciated!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerm</title>
		<link>http://www.dustypixels.com/blog/2008/01/15/targeting-movieclip-from-an-as3-class-file-reply/comment-page-1/#comment-108180</link>
		<dc:creator>Jerm</dc:creator>
		<pubDate>Sat, 28 Feb 2009 01:06:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.dustypixels.com/blog/2008/01/15/targeting-movieclip-from-an-as3-class-file-reply/#comment-108180</guid>
		<description>I&#039;m trying use a Class to control a bunch of movieclips I have created and instanced in Flash. I&#039;ve already got the .swf working using only Flash, but I&#039;m trying to learn how to write classes. (Reading past the added array stuff, which seems to be working in Flash) My references to, for example, topTextMischief_mc.visible = true is not working in the class. I get this error:

ReferenceError: Error #1069: Property topTextMischief_mc not found on ShowHide and there is no default value.
	at ShowHide()
	at testingarrayreplacement_fla::MainTimeline/displayRecipe()
	at testingarrayreplacement_fla::MainTimeline/mischeifIn().

Here is the Class I have tried to create:

package 
{
  import flash.display.MovieClip;
  public class ShowHide extends MovieClip 
  {
    public var _buttonNumber:Number;
    public var elementNames:Array = [&quot;Mischief&quot;,&quot;SnapDragon&quot;,&quot;ShanghaiLemonDrop&quot;,&quot;AppleBlossom&quot;,&quot;GingerSnap&quot;,&quot;Yazitini&quot;];
    public var subElementNames:Array = [&quot;topText&quot;,&quot;circleText&quot;,&quot;glass&quot;];
    private var graphicState:Boolean = false;

    public function ShowHide(bNum:Number) {

      _buttonNumber = bNum -1;

      for (var i:Number = 0; i &lt; 6; i++) {
	if (i == _buttonNumber) {
	  graphicState = true;
	}
	else {
	  graphicState = false;
	}
	for (var j:Number = 0; j &lt; 3; j++) {
	
      	 this[subElementNames[j] + elementNames[i] +&quot;_mc&quot;].visible = graphicState;
	  // trace(subElementNames[j] + elementNames[i] + graphicState);
	}
   
      }

    }
  }
}

What could I do to get this working?

I&#039;m afraid the answer to me should be &quot;learn how Flash works, oh ignorant one.&quot; Or &quot;Try starting at the beginning, instead of diving into the deep end of Classes too early.&quot;

This IS only my second Flash site... I have spent hours and hours trying to figure this out from books and the web, to no avail.

Here is the comp of the site I am working on:
www.bolesky.com/yazi</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying use a Class to control a bunch of movieclips I have created and instanced in Flash. I&#8217;ve already got the .swf working using only Flash, but I&#8217;m trying to learn how to write classes. (Reading past the added array stuff, which seems to be working in Flash) My references to, for example, topTextMischief_mc.visible = true is not working in the class. I get this error:</p>
<p>ReferenceError: Error #1069: Property topTextMischief_mc not found on ShowHide and there is no default value.<br />
	at ShowHide()<br />
	at testingarrayreplacement_fla::MainTimeline/displayRecipe()<br />
	at testingarrayreplacement_fla::MainTimeline/mischeifIn().</p>
<p>Here is the Class I have tried to create:</p>
<p>package<br />
{<br />
  import flash.display.MovieClip;<br />
  public class ShowHide extends MovieClip<br />
  {<br />
    public var _buttonNumber:Number;<br />
    public var elementNames:Array = ["Mischief","SnapDragon","ShanghaiLemonDrop","AppleBlossom","GingerSnap","Yazitini"];<br />
    public var subElementNames:Array = ["topText","circleText","glass"];<br />
    private var graphicState:Boolean = false;</p>
<p>    public function ShowHide(bNum:Number) {</p>
<p>      _buttonNumber = bNum -1;</p>
<p>      for (var i:Number = 0; i &lt; 6; i++) {<br />
	if (i == _buttonNumber) {<br />
	  graphicState = true;<br />
	}<br />
	else {<br />
	  graphicState = false;<br />
	}<br />
	for (var j:Number = 0; j &lt; 3; j++) {</p>
<p>      	 this[subElementNames[j] + elementNames[i] +&#8221;_mc&#8221;].visible = graphicState;<br />
	  // trace(subElementNames[j] + elementNames[i] + graphicState);<br />
	}</p>
<p>      }</p>
<p>    }<br />
  }<br />
}</p>
<p>What could I do to get this working?</p>
<p>I&#8217;m afraid the answer to me should be &#8220;learn how Flash works, oh ignorant one.&#8221; Or &#8220;Try starting at the beginning, instead of diving into the deep end of Classes too early.&#8221;</p>
<p>This IS only my second Flash site&#8230; I have spent hours and hours trying to figure this out from books and the web, to no avail.</p>
<p>Here is the comp of the site I am working on:<br />
<a href="http://www.bolesky.com/yazi" rel="nofollow">http://www.bolesky.com/yazi</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
