Answered
Help applying an action to a bunch of child movie clips
Hi folks,
I'm trying to build a dealer locator map. I figured it would take me a day to figure out, and I've been struggling with it for a week. I've got almost all of it done, but there's one thing I still can't get a handle on.
I've got an accordion component containing the list of dealers called "myAccordion". I'm loading an xml file in it like so:
var my_xml:XML = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success:Boolean) {
myLabel.text = this.firstChild.childNodes[0];
myTextArea.text = this.firstChild.childNodes[1];
myTextArea2.text = this.firstChild.childNodes[2];
myTextArea3.text = this.firstChild.childNodes[3];
myTextArea4.text = this.firstChild.childNodes[4];
};
my_xml.load("ny.xml");
Then I have a movieclip called "map". In it are 50 child movie clips (one for each state) which are named "NY" (for new york), "WA" (for washington), etc.
When someone clicks on a state, I need 2 things to happen:
1. change the color of the state
3. load an xml doc with the same name (wa.xml, ny.xml, etc.) into myAccordion
How do I apply an action to all of the children of the map that will do that?
I'm trying to build a dealer locator map. I figured it would take me a day to figure out, and I've been struggling with it for a week. I've got almost all of it done, but there's one thing I still can't get a handle on.
I've got an accordion component containing the list of dealers called "myAccordion". I'm loading an xml file in it like so:
var my_xml:XML = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success:Boolean) {
myLabel.text = this.firstChild.childNodes[0];
myTextArea.text = this.firstChild.childNodes[1];
myTextArea2.text = this.firstChild.childNodes[2];
myTextArea3.text = this.firstChild.childNodes[3];
myTextArea4.text = this.firstChild.childNodes[4];
};
my_xml.load("ny.xml");
Then I have a movieclip called "map". In it are 50 child movie clips (one for each state) which are named "NY" (for new york), "WA" (for washington), etc.
When someone clicks on a state, I need 2 things to happen:
1. change the color of the state
3. load an xml doc with the same name (wa.xml, ny.xml, etc.) into myAccordion
How do I apply an action to all of the children of the map that will do that?