I couldn't follow your logic exactly, but I figure I could show you some basic looping tricks.

Hope this helps... :


var linkArray:Array = new Array();

for (var i = 0; i < countyNodes.length; i++) {

        linkArray[i] = new Array(); // nested array

linkArray[i].thisCounty = countyNodes [i].firstChild.firstChild.nodeValue;
        linkArray[i].thisLink   = countyNodes[i].lastChild.firstChild.nodeValue;

}


...


// i = active movieClip

var myMC:MovieClip = this["countyMC"+i];

myColor = new Color(myMC);
myColor.setRBG(out_color);

if (linkArray[i].thisLink == undefined || Douglas_URL == "") {
        myMC._visible = false;
}






On Oct 9, 2006, at 11:59 AM, Deanna Schneider wrote:

Hi All,
I'm working off of something that someone else coded, and trying to
make it read some xml data (it was just reading a static include).
Anyway, it loops through 72 county nodes. I've got this part working:

//loop through and set all the county vars
var countyNodeLength = countyNodes.length;
for (var i = 0; i < countyNodeLength; i++) {
        thisCounty = countyNodes[i].firstChild.firstChild.nodeValue;
        thisLink = countyNodes[i].lastChild.firstChild.nodeValue
       // this line sets the vars - I couldn't get it to work
properly using the "var" keyword
        set (thisCounty + "_URL",  thisLink);
}

But, a litte later on, he had hardcoded the following stuff 72 times,
where Douglas is one example of a value that would be in the
"thisCounty" set in the loop above:

Douglas_color = new Color(_root.Douglas.btn_color);
Douglas_color.setRGB(out_color);

if (Douglas_URL == "undefined" || Douglas_URL == undefined) {
        Douglas._visible = false;
}

I haven't been able to figure out a way to set that dynamically as I
run through the loop. Is it even possible to do that much dynamic
evaluation?

Thanks in advance.
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





------------------------------------------------------------------------ ------
Radley Marx
[EMAIL PROTECTED]
310.220.4088
http://www.radleymarx.com
------------------------------------------------------------------------ ------




_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to