I get weather data as xml and want to use it with flash. So I wrote this code, but “if” part of this code doesn’t work correctly. Eventhough the wether is cloudy, swf shows sunny movieclip.
Please help me where is the problem? :hangover:
System.useCodePage = true;
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success) {
if (success) {
//trace(“load successful!”);
weather = myXML.firstChild.childNodes[0].childNodes[6].firstChild;
} else {
trace(“xml file could not be loaded!!”);
}
};
myXML.load(“weather.xml”);
setProperty(“cloudy_mc”, _visible, false);
setProperty(“sunny_mc”, _visible, false);
[SIZE=3][COLOR=blue]if (weather == “cloudy”) {[/COLOR]
[COLOR=blue]setProperty(“cloudy_mc”, _visible, true);[/COLOR]
[COLOR=blue]} else {[/COLOR]
[COLOR=blue]setProperty(“sunny_mc”, _visible, true);[/COLOR]
[COLOR=blue]}[/COLOR][/SIZE]