1

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

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

I came across an article that says there's a bug, loader.dataFormat = URLLoaderDataFormat.VARIABLES.toUpperCase() did the trick, (it has to be uppercase)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.