<?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: Develop an OOP Drop Down Menu Using ActionScript 3.0 Documents</title>
	<atom:link href="http://active.tutsplus.com/tutorials/xml/develop-an-oop-drop-down-menu-using-actionscript-30-documents/feed/" rel="self" type="application/rss+xml" />
	<link>http://active.tutsplus.com/tutorials/xml/develop-an-oop-drop-down-menu-using-actionscript-30-documents/</link>
	<description>Flash, Flex &#38; ActionScript Tutorials</description>
	<lastBuildDate>Fri, 19 Mar 2010 20:45:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: André</title>
		<link>http://active.tutsplus.com/tutorials/xml/develop-an-oop-drop-down-menu-using-actionscript-30-documents/comment-page-1/#comment-19617</link>
		<dc:creator>André</dc:creator>
		<pubDate>Mon, 08 Mar 2010 21:20:55 +0000</pubDate>
		<guid isPermaLink="false">http://flash.tutsplus.com/?p=631#comment-19617</guid>
		<description>Please, post your compilation errors here, them maybe i can help
:D</description>
		<content:encoded><![CDATA[<p>Please, post your compilation errors here, them maybe i can help<br />
 <img src='http://active.tutsplus.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Fallai</title>
		<link>http://active.tutsplus.com/tutorials/xml/develop-an-oop-drop-down-menu-using-actionscript-30-documents/comment-page-1/#comment-19413</link>
		<dc:creator>Michael Fallai</dc:creator>
		<pubDate>Sat, 06 Mar 2010 01:43:03 +0000</pubDate>
		<guid isPermaLink="false">http://flash.tutsplus.com/?p=631#comment-19413</guid>
		<description>I&#039;m embarrassed that I posted my dumb mistakes with ==. I&#039;m still working on this, your version did not compile; I figured out a way to get it to compile but it still does not work. When I figure it out I will post a solution. Thanks for responding.</description>
		<content:encoded><![CDATA[<p>I&#8217;m embarrassed that I posted my dumb mistakes with ==. I&#8217;m still working on this, your version did not compile; I figured out a way to get it to compile but it still does not work. When I figure it out I will post a solution. Thanks for responding.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: André</title>
		<link>http://active.tutsplus.com/tutorials/xml/develop-an-oop-drop-down-menu-using-actionscript-30-documents/comment-page-1/#comment-19159</link>
		<dc:creator>André</dc:creator>
		<pubDate>Mon, 01 Mar 2010 13:08:28 +0000</pubDate>
		<guid isPermaLink="false">http://flash.tutsplus.com/?p=631#comment-19159</guid>
		<description>Hi, if you can post anywhere i can see what happen and give you the solution, sorry for the late answear...

There are some things that i could see that maybe be wrong...

For first, if the container is an Sprite object, it´s not dynamic, so you cant access the children by using container[i].value, you can use container.getChildAt(i) to access the child...

Also it seems that you´re trying to set the value with two equals (==) it is for comparation only, when you set a property you use single equal (=)...

your code:
container[i].value == _old_value;
container[i].caption == _old_caption;

Correct:
container[i].value = _old_value;
container[i].caption = _old_caption;

Since it´s property you set this way, not like argument... it´s like a variable, but it´s a property so it activates a function...


So... try:

private function menuItemClick(e:MouseEvent):void{
if(e.currentTarget.value!=_value &amp;&amp; e.currentTarget.caption!=txt.text){
dispatchEvent(new DropDownMenuEvent(DropDownMenuEvent.CHANGE,e.currentTarget.caption,e.currentTarget.value));
_old_value = _value;
_old_caption = txt.text;
_value=e.currentTarget.value;
txt.text=e.currentTarget.caption;
for(var i:int=0;i&lt;container.numChildren;i++) {
if (Sprite(container.getChildAt(i)).caption == txt.text) {
Sprite(container.getChildAt(i)).value = _old_value;
Sprite(container.getChildAt(i)).caption = _old_caption;
break;
}
}
}

Maybe it work, i dont know how is the rest of your code, but if you need more help with this you can add group225300@groupsim.com in your msn or yahoo messenger, i am everyday there and i can help you more with this...</description>
		<content:encoded><![CDATA[<p>Hi, if you can post anywhere i can see what happen and give you the solution, sorry for the late answear&#8230;</p>
<p>There are some things that i could see that maybe be wrong&#8230;</p>
<p>For first, if the container is an Sprite object, it´s not dynamic, so you cant access the children by using container[i].value, you can use container.getChildAt(i) to access the child&#8230;</p>
<p>Also it seems that you´re trying to set the value with two equals (==) it is for comparation only, when you set a property you use single equal (=)&#8230;</p>
<p>your code:<br />
container[i].value == _old_value;<br />
container[i].caption == _old_caption;</p>
<p>Correct:<br />
container[i].value = _old_value;<br />
container[i].caption = _old_caption;</p>
<p>Since it´s property you set this way, not like argument&#8230; it´s like a variable, but it´s a property so it activates a function&#8230;</p>
<p>So&#8230; try:</p>
<p>private function menuItemClick(e:MouseEvent):void{<br />
if(e.currentTarget.value!=_value &amp;&amp; e.currentTarget.caption!=txt.text){<br />
dispatchEvent(new DropDownMenuEvent(DropDownMenuEvent.CHANGE,e.currentTarget.caption,e.currentTarget.value));<br />
_old_value = _value;<br />
_old_caption = txt.text;<br />
_value=e.currentTarget.value;<br />
txt.text=e.currentTarget.caption;<br />
for(var i:int=0;i&lt;container.numChildren;i++) {<br />
if (Sprite(container.getChildAt(i)).caption == txt.text) {<br />
Sprite(container.getChildAt(i)).value = _old_value;<br />
Sprite(container.getChildAt(i)).caption = _old_caption;<br />
break;<br />
}<br />
}<br />
}</p>
<p>Maybe it work, i dont know how is the rest of your code, but if you need more help with this you can add <a href="mailto:group225300@groupsim.com">group225300@groupsim.com</a> in your msn or yahoo messenger, i am everyday there and i can help you more with this&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Fallai</title>
		<link>http://active.tutsplus.com/tutorials/xml/develop-an-oop-drop-down-menu-using-actionscript-30-documents/comment-page-1/#comment-19037</link>
		<dc:creator>Michael Fallai</dc:creator>
		<pubDate>Fri, 26 Feb 2010 17:36:57 +0000</pubDate>
		<guid isPermaLink="false">http://flash.tutsplus.com/?p=631#comment-19037</guid>
		<description>I found one (pair of) mistakes, the new value/caption needs to be passed as an argument. This still does not get it to work, however...

container[i].value(old_value);
container[i].caption(_old_caption);</description>
		<content:encoded><![CDATA[<p>I found one (pair of) mistakes, the new value/caption needs to be passed as an argument. This still does not get it to work, however&#8230;</p>
<p>container[i].value(old_value);<br />
container[i].caption(_old_caption);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Fallai</title>
		<link>http://active.tutsplus.com/tutorials/xml/develop-an-oop-drop-down-menu-using-actionscript-30-documents/comment-page-1/#comment-19036</link>
		<dc:creator>Michael Fallai</dc:creator>
		<pubDate>Fri, 26 Feb 2010 17:16:03 +0000</pubDate>
		<guid isPermaLink="false">http://flash.tutsplus.com/?p=631#comment-19036</guid>
		<description>I am customizing the drop-down menu due to space considerations. This is for a chart of commodity values and I want users to be able to select one of three metals as well as one of three periods to chart. The chart would start with an initial value (&#039;gold&#039; and &#039;week&#039;, which charts gold quotes over the past week), and the matching caption would appear in place of &quot;Select&quot;. The other unselected values should appear in the drop-down menu; when someone selects a caption in the drop-down menu, I want that caption to swap places with the first position (where &quot;Select&quot; currently appears).

Since the value is the same as the caption, I&#039;m not worried about transferring the value (since &quot;Select&quot;&#039;s parent is not a MenuItem object).

1) Initialization:
     a) when the drop-down list is initialized, I got rid of &#039;txt.text = &quot;Select&quot;&#039; and instead I put in the first caption from the XML file. All subsequent caption/value pairs create a MenuItem object.

2) OK here is the problem: I am trying to figure out how to access the MenuItem object - already created - whose caption matches &#039;e.currentTarget.caption&#039; in the menuItemClick function.
     a) added set functions to MenuItem for both caption and value
     b) in DropDownMenu.as, changed &#039;menuItemClick&#039; as follows:

private function menuItemClick(e:MouseEvent):void{
			if(e.currentTarget.value!=_value &amp;&amp; e.currentTarget.caption!=txt.text){
				dispatchEvent(new DropDownMenuEvent(DropDownMenuEvent.CHANGE,e.currentTarget.caption,e.currentTarget.value));
				_old_value = _value;
				_old_caption = txt.text;
				_value=e.currentTarget.value;
				txt.text=e.currentTarget.caption;
				for(var i:int=0;i&lt;container.numChildren;i++) {
					if (container[i].caption == txt.text) {
						container[i].value == _old_value;
						container[i].caption == _old_caption;
						break;
						}
					}
			}

this does not change any of the existing MenuItem objects&#039; captions. I even added an &#039;else&#039; so that if there is no match, it should change each tested caption anyway to something like, &#039;tested&#039;.

What am I missing here? Thanks in advance.</description>
		<content:encoded><![CDATA[<p>I am customizing the drop-down menu due to space considerations. This is for a chart of commodity values and I want users to be able to select one of three metals as well as one of three periods to chart. The chart would start with an initial value (&#8216;gold&#8217; and &#8216;week&#8217;, which charts gold quotes over the past week), and the matching caption would appear in place of &#8220;Select&#8221;. The other unselected values should appear in the drop-down menu; when someone selects a caption in the drop-down menu, I want that caption to swap places with the first position (where &#8220;Select&#8221; currently appears).</p>
<p>Since the value is the same as the caption, I&#8217;m not worried about transferring the value (since &#8220;Select&#8221;&#8217;s parent is not a MenuItem object).</p>
<p>1) Initialization:<br />
     a) when the drop-down list is initialized, I got rid of &#8216;txt.text = &#8220;Select&#8221;&#8216; and instead I put in the first caption from the XML file. All subsequent caption/value pairs create a MenuItem object.</p>
<p>2) OK here is the problem: I am trying to figure out how to access the MenuItem object &#8211; already created &#8211; whose caption matches &#8216;e.currentTarget.caption&#8217; in the menuItemClick function.<br />
     a) added set functions to MenuItem for both caption and value<br />
     b) in DropDownMenu.as, changed &#8216;menuItemClick&#8217; as follows:</p>
<p>private function menuItemClick(e:MouseEvent):void{<br />
			if(e.currentTarget.value!=_value &amp;&amp; e.currentTarget.caption!=txt.text){<br />
				dispatchEvent(new DropDownMenuEvent(DropDownMenuEvent.CHANGE,e.currentTarget.caption,e.currentTarget.value));<br />
				_old_value = _value;<br />
				_old_caption = txt.text;<br />
				_value=e.currentTarget.value;<br />
				txt.text=e.currentTarget.caption;<br />
				for(var i:int=0;i&lt;container.numChildren;i++) {<br />
					if (container[i].caption == txt.text) {<br />
						container[i].value == _old_value;<br />
						container[i].caption == _old_caption;<br />
						break;<br />
						}<br />
					}<br />
			}</p>
<p>this does not change any of the existing MenuItem objects&#039; captions. I even added an &#039;else&#039; so that if there is no match, it should change each tested caption anyway to something like, &#039;tested&#039;.</p>
<p>What am I missing here? Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: André</title>
		<link>http://active.tutsplus.com/tutorials/xml/develop-an-oop-drop-down-menu-using-actionscript-30-documents/comment-page-1/#comment-13472</link>
		<dc:creator>André</dc:creator>
		<pubDate>Mon, 14 Dec 2009 11:51:16 +0000</pubDate>
		<guid isPermaLink="false">http://flash.tutsplus.com/?p=631#comment-13472</guid>
		<description>Hello vagz, thanks for your comment...

1. The point of this tutorial is really to create a custom object using xml external file, it´s much easyer you update an xml file instead of opening flash and change the values from there, that´s why exists the insteraction of flash and xml, for easyer updates, and this is the porpouse of this tutorial...

2. As you can see at step 5, we created a custom event for the menu, when it´s changed, and in step 8, i showed how to use this event to get the values from the drop down menu, instead of using trace, you can use whenever you want... for example in line:

private function d2Change(e:DropDownMenuEvent):void{    
trace(e.caption+&quot; = &quot;+e.value);
}

instead of trace you can use gotoAndPlay(e.value);
but you would need to change the value in xml for a number value... OR also could it be a string value but the timeline would need to have a labeled keyframe... for example, in contactlist3.xml there is:

   

you could use:



or:

  

I hope this clear your doubts, if not, just ask again</description>
		<content:encoded><![CDATA[<p>Hello vagz, thanks for your comment&#8230;</p>
<p>1. The point of this tutorial is really to create a custom object using xml external file, it´s much easyer you update an xml file instead of opening flash and change the values from there, that´s why exists the insteraction of flash and xml, for easyer updates, and this is the porpouse of this tutorial&#8230;</p>
<p>2. As you can see at step 5, we created a custom event for the menu, when it´s changed, and in step 8, i showed how to use this event to get the values from the drop down menu, instead of using trace, you can use whenever you want&#8230; for example in line:</p>
<p>private function d2Change(e:DropDownMenuEvent):void{<br />
trace(e.caption+&#8221; = &#8220;+e.value);<br />
}</p>
<p>instead of trace you can use gotoAndPlay(e.value);<br />
but you would need to change the value in xml for a number value&#8230; OR also could it be a string value but the timeline would need to have a labeled keyframe&#8230; for example, in contactlist3.xml there is:</p>
<p>you could use:</p>
<p>or:</p>
<p>I hope this clear your doubts, if not, just ask again</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vagz</title>
		<link>http://active.tutsplus.com/tutorials/xml/develop-an-oop-drop-down-menu-using-actionscript-30-documents/comment-page-1/#comment-13238</link>
		<dc:creator>vagz</dc:creator>
		<pubDate>Wed, 09 Dec 2009 13:13:24 +0000</pubDate>
		<guid isPermaLink="false">http://flash.tutsplus.com/?p=631#comment-13238</guid>
		<description>Hello,

Good tutorial but i have a couple of questions... (bare with me i&#039;m new at this)

1. Can&#039;t it use 1 xml file instead of multiple? Because if you want to update the data it is easier that way.

2. Instead of an external url can it take you to a different frame of the flash file?</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Good tutorial but i have a couple of questions&#8230; (bare with me i&#8217;m new at this)</p>
<p>1. Can&#8217;t it use 1 xml file instead of multiple? Because if you want to update the data it is easier that way.</p>
<p>2. Instead of an external url can it take you to a different frame of the flash file?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: André</title>
		<link>http://active.tutsplus.com/tutorials/xml/develop-an-oop-drop-down-menu-using-actionscript-30-documents/comment-page-1/#comment-10654</link>
		<dc:creator>André</dc:creator>
		<pubDate>Wed, 04 Nov 2009 11:23:38 +0000</pubDate>
		<guid isPermaLink="false">http://flash.tutsplus.com/?p=631#comment-10654</guid>
		<description>Sorry, the coment just got away my xml...

but the same structure, just the caption for the first you change for &quot;google&quot; and it´s value change to http://www.google.com and for the second line of the xml file you change the caption to &quot;yahoo&quot; and it´s value to http://www.yahoo.com, and test it with the navigateToURL

I hope you put it working</description>
		<content:encoded><![CDATA[<p>Sorry, the coment just got away my xml&#8230;</p>
<p>but the same structure, just the caption for the first you change for &#8220;google&#8221; and it´s value change to <a href="http://www.google.com" rel="nofollow">http://www.google.com</a> and for the second line of the xml file you change the caption to &#8220;yahoo&#8221; and it´s value to <a href="http://www.yahoo.com" rel="nofollow">http://www.yahoo.com</a>, and test it with the navigateToURL</p>
<p>I hope you put it working</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: André</title>
		<link>http://active.tutsplus.com/tutorials/xml/develop-an-oop-drop-down-menu-using-actionscript-30-documents/comment-page-1/#comment-10653</link>
		<dc:creator>André</dc:creator>
		<pubDate>Wed, 04 Nov 2009 11:20:51 +0000</pubDate>
		<guid isPermaLink="false">http://flash.tutsplus.com/?p=631#comment-10653</guid>
		<description>Hi, thanks for your words.

You can create a XML file like this:

  
      
      
&lt;/menu

Them, in the Main.as file you have the line:

private function d2Change(e:DropDownMenuEvent):void{    trace(e.caption+&quot; = &quot;+e.value);
}

the e.caption will be the selected item caption, and the e.value will be the selected item value, so instead of using trace you can use for example navigateToURL...

so:

private function d2Change(e:DropDownMenuEvent):void{
navigateToURL(new URLRequest(e.value)); //it will open the selected url from the box
}</description>
		<content:encoded><![CDATA[<p>Hi, thanks for your words.</p>
<p>You can create a XML file like this:</p>
<p>&lt;/menu</p>
<p>Them, in the Main.as file you have the line:</p>
<p>private function d2Change(e:DropDownMenuEvent):void{    trace(e.caption+&quot; = &quot;+e.value);<br />
}</p>
<p>the e.caption will be the selected item caption, and the e.value will be the selected item value, so instead of using trace you can use for example navigateToURL&#8230;</p>
<p>so:</p>
<p>private function d2Change(e:DropDownMenuEvent):void{<br />
navigateToURL(new URLRequest(e.value)); //it will open the selected url from the box<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Radiculous</title>
		<link>http://active.tutsplus.com/tutorials/xml/develop-an-oop-drop-down-menu-using-actionscript-30-documents/comment-page-1/#comment-10580</link>
		<dc:creator>Radiculous</dc:creator>
		<pubDate>Tue, 03 Nov 2009 06:39:41 +0000</pubDate>
		<guid isPermaLink="false">http://flash.tutsplus.com/?p=631#comment-10580</guid>
		<description>Hi Andre! 

I&#039;m referencing your tuturial for a project that I am doing, so far everything has been going great (so to say) when I stumbled upon a dead end.. and this is probably the stupidest question asked, 

I am a noob at this so bear with me..

in your XML file, you have a value = &quot;email address&quot; from my understanding you&#039;re able to change the email addy to a  URL link, but how do I access the URL so that when I click on the links, it actually calls upon external links? I know it has something to do with the e.value variable but I can&#039;t seem to get it to work..

Please help.

Thank you.</description>
		<content:encoded><![CDATA[<p>Hi Andre! </p>
<p>I&#8217;m referencing your tuturial for a project that I am doing, so far everything has been going great (so to say) when I stumbled upon a dead end.. and this is probably the stupidest question asked, </p>
<p>I am a noob at this so bear with me..</p>
<p>in your XML file, you have a value = &#8220;email address&#8221; from my understanding you&#8217;re able to change the email addy to a  URL link, but how do I access the URL so that when I click on the links, it actually calls upon external links? I know it has something to do with the e.value variable but I can&#8217;t seem to get it to work..</p>
<p>Please help.</p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.100 seconds -->
