# URLLoader data not being recognized by conditional statement - AS3

**URL:** <https://forum.kirupa.com/t/urlloader-data-not-being-recognized-by-conditional-statement-as3/289527>\
**Category:** flash\
**Created:** [June 1, 2009, 1:44pm UTC](https://forum.kirupa.com/t/urlloader-data-not-being-recognized-by-conditional-statement-as3/289527 "2009-06-01T13:44:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidJF](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@DavidJF](https://forum.kirupa.com/u/DavidJF)\
**Post date:** [June 1, 2009, 1:44pm UTC](https://forum.kirupa.com/t/urlloader-data-not-being-recognized-by-conditional-statement-as3/289527/1 "2009-06-01T13:44:21Z")

</div>

Hi,

I am loading data from php using the echo method into flash via the URL loader:URLLoader method. The data then gets assigned to an object.

My problem is that the loaded data is being imported in fine and I can trace it and even display it in a text box, but if I try and use this data in a conditional statement - the statement just won’t recognize its value?

Below is a sample of my code…  
I’m pulling my hair out atm…

My PHP—v  
$row = mysql\_fetch\_array($query);  
echo “result=success”;  
echo “&unit=$row[unit]”;

My AS3—v  
var loader:URLLoader = URLLoader(e.target);  
var result = loader.data.result;

```
if (result == "success")
	{
	var n = loader.data;
		
	[COLOR="Lime"]if (n.unit == "inchs") {
            }[/COLOR]
            
            else {

```

}

END CODE  
My problem is in green above. The variable/data being imported in is indicating which measuring unit the user preferred - “inchs” for inch’s or “cms” for centimeter’s.

The statement never seems to recognize this data and always proves false and ‘else’ is executed.

However if I instruct the data to be displayed in a text box eg.  
“display.text = n.unit;” The text box displays the correct result as if the data has came across fine?

Any help would be greatly appreciated. Cheers
