Loaded variables from php collected in flash DEFY If-then

[COLOR=#0000ff]Hi to all gurus,

Here is a small program in flash which calls values from PHP and displays them correctly. [/COLOR]


[SIZE=2]//=================================[/SIZE]
[SIZE=2]// INIT[/SIZE]
[SIZE=2]//=================================[/SIZE]
[SIZE=2]path = "http://localhost/xampp/nwjv/php/"; //declare path to php files[/SIZE]
[SIZE=2]lvOut = new LoadVars(); //create lv object sending variables OUT to php[/SIZE]
[SIZE=2]lvIn = new LoadVars(); //create lv object receiving variables IN from php[/SIZE]
[SIZE=2]
[/SIZE]
[SIZE=2]lvIn.onLoad = function (success) {[/SIZE]
[SIZE=2] if(success)[/SIZE]
[SIZE=2] {[/SIZE]
[SIZE=2] //PHP variable value to textbox[/SIZE]
[SIZE=2]
 InVal = lvIn.returnVal;[/SIZE]
[SIZE=2] InTxt = lvIn.retVal;[/SIZE]

[SIZE=2]     output.text = InVal;[/SIZE]
[SIZE=2]     output1.text = InTxt;    [/SIZE]
[SIZE=2]
[/SIZE]
[SIZE=2]//      output1.text = "No Value";[/SIZE]
[SIZE=2]/*    [/SIZE]
[SIZE=2]     if(InTxt == 'lo' )[/SIZE]
[SIZE=2]    {[/SIZE]
[SIZE=2]         output1.text = "Low Value";[/SIZE]
[SIZE=2]     }[/SIZE]
[SIZE=2]     [/SIZE]
[SIZE=2]    if(InTxt == 'hi')[/SIZE]
[SIZE=2]     {[/SIZE]
[SIZE=2]          output1.text = "High Value";[/SIZE]
[SIZE=2]    }[/SIZE]
[SIZE=2]*/[/SIZE]
[SIZE=2] }else{[/SIZE]
[SIZE=2] //...or notify of failure[/SIZE]
[SIZE=2] output.text = "fail";[/SIZE]
[SIZE=2] }[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]
[/SIZE]
[SIZE=2]//=================================[/SIZE]
[SIZE=2]// BTN CODE[/SIZE]
[SIZE=2]//=================================[/SIZE]
[SIZE=2]myBtn.onRelease = function(){[/SIZE]
[SIZE=2] //assign user-input value to lv property called years[/SIZE]
[SIZE=2] lvOut.years = years.text;[/SIZE]
[SIZE=2] //send to a blank window[/SIZE]
[SIZE=2]// lvOut.send(path + "dogyears_new1.php",lvIn,"GET");[/SIZE]
[SIZE=2]   lvOut.sendAndLoad(path + "dogyears_new1.php",lvIn,"GET");[/SIZE]
[SIZE=2]};[/SIZE]

[COLOR=#0000ff]& the simplest PHP code[/COLOR]


<?php$calculation = $_GET["years"]*2;
if($calculation <=10 ) $retVal="lo";if($calculation > 10)  $retVal="hi";
echo "&returnVal=$calculation &retVal=$retVal" ;?>  

[COLOR=#0000FF]PHP returns two values which are collected by flash in variables InVal and InTxt. The values collected are correct and are displayed thus in the 2 output boxes. [/COLOR]

[COLOR=#0000FF]Now if i the commented out If then block is activated by removing the /* */ from around it and the program is run, clearly the if then blocks fail since the comparison of InTxt fails. It completely fails me why this is happening. While I can display the values correctly, I can’t use them in conditional loops. I have even tried them in switch case statements with the same frustrating result. ( The output1.text remains equal to “No Value” when it should change to either "High Value " or “Low Value”)[/COLOR]

[COLOR=#0000FF]Earlier I was using numbers and when that failed I tried to use strings since I thought that for some reason PHP returns everything as strings. But as can be seen, even the string comparison fails. [/COLOR]

[COLOR=#0000FF]Can someone please comment on this behavior and suggest a solution. [/COLOR]
[COLOR=#0000FF]Thanks loads all ![/COLOR]