Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

JSON.decode undefined method #185

Open
ChazUK opened this Issue · 3 comments

3 participants

@ChazUK

Hi,

I recently upgraded to CS6, and had to re-setup all of my AS3 library links. I created a main folder called lib/ and then copied caurina Tweener (/caruina/transitions/...), greensock (/com/greensock/...) and as3corelib (/com/adobe/...) into the lib folder.
Now a previous file I had working is throwing up errors that JSON.decode isn't a defined method..

jsonData = JSON.decode(dataLoader.data);
Call to a possibly undefined method decode through a reference with static type Class.``

However... jsonData = com.adobe.serialization.json.JSON.decode(dataLoader.data); Works perfectly.

Is there a class clash that I'm not seeing here? It's a clean install of CS6, and those are the only scripts I've added to my libs folder.

Thanks for the help

@ChazUK

I'm sorry but I'm going to bump this because I can't figure out how to fix this. And it kinda makes this class impossible to use!

Has anyone else got this problem? And does anyone have a solution?

@zechdc

Solution

  1. Go to File > Publish Settings...
  2. Change Target from Flash Player 11 to Flash Player 10.3 or lower

If you need to publish in Flash Player 11 or greater then use the native flash JSON class. Look into the native JSON class and the static parse() and stringify() methods.

Source:
http://forums.adobe.com/message/4561200

@jhey

thanks for the tip @ChazUK !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.