<?xml version="1.0" encoding="iso-8859-1"?><rss version="2.0">
<channel><title><![CDATA[ActionScript.org Flash, Flex and ActionScript Resources - Comments for article: Using attachMovie]]></title><link>http://www.actionscript.org/resources</link><description /><language>en-us</language><copyright><![CDATA[http://www.actionscript.org/resources]]></copyright><generator>N/A</generator><webMaster>general.redirect@gmail.com</webMaster><lastBuildDate>Mon, 23 Nov 2009 10:53:03 CST</lastBuildDate><ttl>20</ttl><item><title><![CDATA[Comment #1]]></title><link>http://www.actionscript.org/resources/articles/42/1/Using-attachMovie/Page1.html#Comment2902</link><description><![CDATA[Add how to use this with a loop to create and position multiple instances of an MC, and you'd have an Excellent article. Still a good beginner article though.<br/><br/>
(Comment posted by eb at 11:52 am, Mon 7th May 2007)]]></description><author>no@spam.com (eb)</author><pubDate><![CDATA[Mon, 07 May 2007 11:52:37 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/42/1/Using-attachMovie/Page1.html#Comment2902</guid></item><item><title><![CDATA[Comment #2]]></title><link>http://www.actionscript.org/resources/articles/42/1/Using-attachMovie/Page1.html#Comment6963</link><description><![CDATA[I ve got to run attachMovie in a loop where i am referencing many MCs(I put the idName in a variable). However, gotpbmes with setting the 'newName'. Anyone knows how? Thanks<br/><br/>
(Comment posted by  at 3:35 pm, Mon 22nd Oct 2007)]]></description><author>no@spam.com ()</author><pubDate><![CDATA[Mon, 22 Oct 2007 15:35:57 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/42/1/Using-attachMovie/Page1.html#Comment6963</guid></item><item><title><![CDATA[Comment #3]]></title><link>http://www.actionscript.org/resources/articles/42/1/Using-attachMovie/Page1.html#Comment11934</link><description><![CDATA[you can do it like this man

var m1:MovieClip=new MovieClip;
for (i=1;i<=10;i++){
 m1=eval("my_mc"+i);
 main.attachmovie("att1", m1, this.getNextHeighstDepth());
 
// then =>
m1._x=i;
// etc ....
}<br/><br/>
(Comment posted by alfrido at 4:07 am, Tue 9th Sep 2008)]]></description><author>no@spam.com (alfrido)</author><pubDate><![CDATA[Tue, 09 Sep 2008 04:07:54 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/42/1/Using-attachMovie/Page1.html#Comment11934</guid></item><item><title><![CDATA[Comment #4]]></title><link>http://www.actionscript.org/resources/articles/42/1/Using-attachMovie/Page1.html#Comment12495</link><description><![CDATA[i'm pretty new at flash and i was wondering if there is a sort of click and destroy the instance feature and if you could say that on release set score reletive to score+1? so plz help m ot<br/><br/>
(Comment posted by Peter at 4:11 pm, Fri 9th Jan 2009)]]></description><author>no@spam.com (Peter)</author><pubDate><![CDATA[Fri, 09 Jan 2009 16:11:08 CST]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/42/1/Using-attachMovie/Page1.html#Comment12495</guid></item><item><title><![CDATA[Comment #5]]></title><link>http://www.actionscript.org/resources/articles/42/1/Using-attachMovie/Page1.html#Comment13557</link><description><![CDATA[I was wondering if I can use this with dynamic text field reading in data from XML. I have placed a few dynamic fields in the movie clip. Here is the code on my main time libe that builds an array and populates with data from XML:

var values:Array = [];
var drugsArr:Array = [O1_mc,O2_mc,O3_mc,O4_mc,O5_mc,O6_mc,O7_mc,O8_mc,O9_mc,O10_mc,O11_mc, 
					  O12_mc,O13_mc,O14_mc,O15_mc,O16_mc,O17_mc,O18_mc,O19_mc,O20_mc,O21_mc,O22_mc,
					  O23_mc,O24_mc,O25_mc,O26_mc,O27_mc,O28_mc,O29_mc,O30_mc,O31_mc,O32_mc,O33_mc,
					  O34_mc,O35_mc,O36_mc,O37_mc,O38_mc,O39_mc,O40_mc,O41_mc,O42_mc,O43_mc,O44_mc,
					  O45_mc,O46_mc,O47_mc,O48_mc,O49_mc,O50_mc];

myXML = new XML();
myXML.ignoreWhite = true;
myXML.load("http://assets.aarp.org/www.aarp.org_/articles/bulletin/interactive/powerof50/oct09/P50_50pills.xml");

myXML.onLoad = function(succes){
if(succes){
	var root = this.firstChild;
	nodes = root.childNodes;
	for (var i = 0; i<nodes.length; i++) { 
		values[i] = { 
		drug:nodes[i].attributes.name, 
		comments:nodes[i].childNodes[0].firstChild.toString() };
		values[i] = {drug:nodes[i].attributes.name, comments:nodes[i].childNodes[0].firstChild.toString(),
		cost:nodes[i].childNodes[1].firstChild.toString(),
		use:nodes[i].childNodes[2].firstChild.toString()};

	}
} else {
trace("Error loading XML document");
}
}


here is te AS in the Movie Clip:

stop();
var len:Number = _root.drugsArr.length;
for ( var n:Number=0; n < len; n++) 
{
	_root.drugsArr[n].Title_txt.text = _root.values[n].drug;
	_root.drugsArr[n].comments_txt.text = _root.values[n].comments;
	_root.drugsArr[n].cost_txt.text = _root.values[n].cost;
	_root.drugsArr[n].use_txt.text = _root.values[n].use;
}


any ideas how to make this work<br/><br/>
(Comment posted by Adam at 8:21 am, Sat 10th Oct 2009)]]></description><author>no@spam.com (Adam)</author><pubDate><![CDATA[Sat, 10 Oct 2009 08:21:01 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/42/1/Using-attachMovie/Page1.html#Comment13557</guid></item></channel></rss>