user689751
user689751

Reputation:

as3 php variables

as3 code:

public function exists(uid:String):void {
        request = new URLRequest("http://localhost/index.php");
        request.method = URLRequestMethod.POST;

        variables = new URLVariables();
        variables.uid = uid;
        request.data = variables;

        loader = new URLLoader();
        loader.dataFormat = URLLoaderDataFormat.VARIABLES;
        loader.addEventListener(Event.COMPLETE, urlLoader_existsHandler);
        loader.load(request);
    }

    protected function urlLoader_existsHandler(event:Event):void {
        trace(event);
        //var variables:URLVariables = URLLoader(event.target).data;
        //trace(variables);
        //trace(variables.success);
    }

PHP output is

success=1&registration_id=1

Error is:

Error Image

Upvotes: 1

Views: 1845

Answers (1)

M Sost
M Sost

Reputation: 1153

Use the TEXT format instead of VARIABLES

loader.dataFormat = URLLoaderDataFormat.TEXT;

Here are the relating docs:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html#dataFormat

Upvotes: 1

Related Questions