That does seem strange. My first thought would be that there might be some
white space characters around the string in the XML. Try:

trace(":" + _root.country + ":");

Or to remove the change that it's messing up somewhere between assigning to
_root, try:

trace(":" + myXML.firstChild.childNodes[4].childNodes[3].childNodes[0] +
":");

in onLoad().

Adrian

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of dls
Sent: 05 February 2006 14:59
To: Flash Coders
Subject: [Flashcoders] variables from XML -- Newbie still having trouble


I am bringing data in from XML, and assigning it a variable name in flash
_root.country = myXML.firstChild.childNodes[4].childNodes[3].childNodes[0];

so far so good, I know it has loaded and when I view my variables
_root.country shows as US.

In my code I am trying to do the following comparison:

if(_root.country == "US"){
//do something
};

Doesn't work. Aren't they both strings? When I test

_root.country = "US";
if(_root.country =="US"){
//do something
};

it works fine.

Is there a way to insert quote marks around the variable from the XML?
Why isn't it working?

Any help would be appreciated!
--dan

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to