Jump to content

baffled why this if stament is not playing cant see an error


hansolo
 Share

Recommended Posts

why wont the if statment in the flash fie not play. The name does equal ben in the broser and ben loads in the flash trace statemnent <?php$username ="ben";echo"&n=".$username;?> ActionScript Code: var result_lv:LoadVars = new LoadVars(); result_lv.onLoad = function(ok){ if (ok) { trace (result_lv.n); //not playing when "n" does have the value "ben" if(result_lv.n == "ben"){ trace("hit"); } } } send_lv = new LoadVars(); send_lv.sendAndLoad("http://localhost/test2.php.",result_lv,"POST");

Edited by hansolo
Link to comment
Share on other sites

i am not very familiar with your coding but....Q: Does n have value in the if-statement? this looks lika a echo and does not seem to give value to n...

echo"&n=".$username;

Link to comment
Share on other sites

yes n does have the value. Whats even more fustrating if copy and paste the same code . it sometimes work in new document and then sometimes doesnt. I have been asking are there some setting which might affect this notepadd++ .or the flash playerWhich i decided to do was copy and paste but this happening alot and when the code is more complex. It can be hard to detect real errors. As there doesnt seem to be an error above. ...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...