This content has been marked as final. Show 8 replies
Assuming PHP script responds to values of empid correctly then the variable in Flash empid may be at fault.
Where is empid declared?
var emplid:String kinda of thing.
Where is empid changed?
Thanks for your reply.
empid comes from a text input field. When traced, the correct empid value is being passed to the load function.
Possibly a caching problem, errors in the concatenation expression of the load method arguments, a variable scoping issue.
I would avoid concatenating the URL variables on the load method because there is a more structured arrangement for send and receive in Flash. See the LoadVars.sendAndLoad example in the Flash 8 help.
I've changed my code to the following, and I am having the same issue. Tracing the success variable comes back as true every call.
var mainLoadVars:LoadVars = new LoadVars();
var mainLoadVarsResult:LoadVars = new LoadVars();
btnMain.onPress = function()
mainLoadVars.nocache = rndNoCache();
//rndNoCache() gives a random number to prevent caching
mainLoadVars.sendAndLoad(urlcut + "/lookup.php",mainLoadVarsResult, "POST");
mainLoadVarsResult.onLoad = function(success:Boolean)
inString = mainLoadVarsResult.toString();
I recommend showing what's happening on the server side. You're asking for a solution and only showing half of the scenario.
You still can add your cache killer to the query string if you want.
Success variable only means there was a successful communication with the server script. It does not account for the data received.
You have verified that using a html form to send data values returns expected values.
//add trace here
trace ("empid:" + empid);
cayennecode makes a good point. If you cannot show code here, then try adding to the PHP script a write to a text file to record its data.
Thank you for your help.
I think there is a problem with the toString() function in the LoadVars class.
I was just using the toString() function, to test what data was coming back. When I actually looked at the variables being returned, they were correct.
I think for LoadVars you just need to trace the object.