How can I do this? Here's what I have:
function send(input):void{
// input.text = "{key: 'value'}"
var x:* = stringToObject(input.text)
// then be able to do this
var y:* = x.key;
// then y must be equal to 'value'
trace(y) // this is just a string
}
You'll need to include the JSON library to be able to parse JSON strings into objects.
Reference the as3corelib library for more info.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.