Passing ByteArray from flash (as3) to AMFPHP (2.0.1)

Posted by Mauro on Stack Overflow See other posts from Stack Overflow or by Mauro
Published on 2012-03-13T04:01:02Z Indexed on 2012/04/11 11:29 UTC
Read the original article Hit count: 276

Filed under:
|
|
|
|

i have a problem passing ByteArray from flash (as3) to amfphp to save an image. With old version of amfphp, all worked in the past… now, with new version i have many problem. I'm using version 2.0.1 and the first problem is that i have to do this, for access to my info:

function SaveAsJPEG($json)
    {
        $string =  json_encode($json);
        $obj = json_decode($string);

        $compressed = $obj->{'compressed'};
    }

in the past i wrote only:

function SaveAsJPEG($json)
    {
        $compressed = $json['compressed'];
    }

Anyway… now i can take all data (if i use " $json['compressed']" i receive an error) but i can't receive my ByteArray data. From flash i write this:

var tempObj:Object = new Object();
tempObj["jpgStream "]=  createBitStream(myBitmmapData);  // return ByteArray
tempObj["compressed"] = false;
tempObj["dir"] = linkToSave;
tempObj["name"] = this.imageName;

So.. in my php class i receive all correct info, except "jpgStream" that seems "null".

Do you have any idea?

© Stack Overflow or respective owner

Related posts about php

Related posts about JSON