# "weather" and "if" :(

**URL:** <https://forum.kirupa.com/t/weather-and-if/180120>\
**Category:** flash\
**Created:** [February 25, 2006, 9:05pm UTC](https://forum.kirupa.com/t/weather-and-if/180120 "2006-02-25T21:05:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeventKA](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/leventka/32/2160_2.png) [@LeventKA](https://forum.kirupa.com/u/LeventKA)\
**Post date:** [February 25, 2006, 9:05pm UTC](https://forum.kirupa.com/t/weather-and-if/180120/1 "2006-02-25T21:05:19Z")

</div>

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]
