modified to use native AS3 JSON classes