Quote:
Originally Posted by IqAndreas
Remove "new" in this line, so it looks like this:
var variables:URLVariables = URLVariables(loader.data);
What you are doing is not recreating a new "URLVariables", you are treating the already existing as a URLVariables.
EDIT: Never mind. I didn't read the code well enough. Try tracing out "loader.data" to see what it looks like. That is the line causing the code, so Flash apparently doesn't like whatever is inside of that string.
|
SOMETHING WORKED!!!
So I tried both things anyway-
1. removing new from the URLvariables statement produced this error. :
//"empty string??Pritikaaatest " is being echoed from the PHP file
TypeError: Error #1034: Type Coercion failed: cannot convert "empty string??Pritikaaatest " to flash.net.URLVariables.
at cursors_fla::MainTimeline/sendHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
So I figured that I needed to adjust the code so that variables.pos was accepting lodaer.data instead.I also put 'new' back in the declaration of new URLvariables().I modified the sendHandler function to this:
function sendHandler(evt:Event):void {
trace("reached sendHandler!");
var loader:URLLoader = URLLoader(evt.target);
trace(loader.data);
var variables:URLVariables = new URLVariables();
variables.pos=loader.data;
trace(variables);
}
I also changed my php file a bit and now I see that not only are there no errors, data is being submitted from the flash file to the database!! woohoo!
Thank you
