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.
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")
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. Please note that the command typeof InTxt (not used in the above code) returns a String suggesting that InTxt is a string variable.
But as can be seen, even the string comparison fails.
Can someone please comment on this behavior and suggest a solution.
Thanks loads to all on the forum for any help.
Thanks for the reply. Really appreciate that. However, forgive me please, but I think you have misunderstood my question because in your code you have totally omitted the commented out portion with the IF - THEN block.
The results that I get from php are just fine as far as displaying them is concerned. InTxt displays 'hi' and 'lo'. However it's when I use InTxt in an IF-Then block, the Intxt kind of defies the conditional tests. It is as if the conditional tests do not recognize the value of Intxt even though flash displays it correctly.
Please find the relevant php and fla files for the above problem zipped in the attached file.
Run those using values in Input < 5 first and then > 5. You will see the numeric results in the output box ( 2* Input) and you will see the 'hi' and 'lo' appear in the output1 box.
Next un-comment the IF - THEN block and try again. You will see that the IF-THEN conditional is bypassed as if there was no value in InTxt and infact that's the default value that would be displayed in the output1 Box (No Value).
Once again I really appreciate your help. I will try out the changes in php you suggested.
Really looking forward to some reply, help, suggestion, solution to this problem.
you needed a trailing & sign to make the vars matchable.
You could of course just have the php send the values instead of altering it inside of flash which would end the problem of adding the extra & sign too.
Thanks loads for that insight. Getting the variables out of the ""and appending values using the dot operator seems to have done it. Grateful to you for that vital pointer.
I would be glad if you could explain the usage of the '&' at the end a little more detailed. Also I could not exactly make out your last statement where you said that it is possible to do away with the '&'. I would be glad if you could explain that with an example.
Thanks again very much. I was stuck on this for almost 3 days.
I believe that vars sent this way seem to have an extra space or something after them, so adding "&" at the end finishes it or cheats it into thinking there is another var, something along those lines, look it up.
The way I did the php is just the way I prefer as you can automatically see any $stuff, the other way would work too.
You can do it like this so you dont need to add the extra "&", just swap the order around.