hansolo Posted March 23, 2013 Share Posted March 23, 2013 (edited) 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 March 23, 2013 by hansolo Link to comment Share on other sites More sharing options...
Rollins Posted March 24, 2013 Share Posted March 24, 2013 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 More sharing options...
hansolo Posted March 24, 2013 Author Share Posted March 24, 2013 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 More sharing options...
Rollins Posted March 24, 2013 Share Posted March 24, 2013 what would this do? single quotes... if(result_lv.n == 'ben'){ trace('hit'); Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now