I have a small Flash game which is written with AS3. My game sends score and game_id. I have my own encrypt class which calls as CryptoCode.
I want to send these variables (score and game_id) as a JSON object which is encrypted and sent to PHP.
How can I create this JSON object? Can anyone answer me with some code?
Native JSON API available in Flash Player since version 11 is documented at http://help.adobe.com/en_US/as3/dev/WS324d8efcab3b0d1e2408f9e3131fddffcfc-8000.html
Basically what you need is to use
JSON.stringify()method and pass your object as a parameter.You will get a serialized JSON string in return.