[英]I need to import something in order to use JSON in AS3?
When using the following codeline: 使用以下代码行时:
var myjson:Object = JSON.parse("path_to_my.json");
I got the following error: 我收到以下错误:
1120: Access of undefined property JSON.
I had to import any package in order to use the JSON.parse? 我必须导入任何软件包才能使用JSON.parse?
Thank you! 谢谢!
[with: Flash CS5 (11.0.0.485), AS3] [with:Flash CS5(11.0.0.485),AS3]
JSON is built in to the ActionScript default package starting at Flash Player 11, and is notably higher performance than 3rd party serializers. 从Flash Player 11开始, JSON内置到ActionScript默认程序包中,并且其性能明显优于第三方串行器。
With Flash CS5, you need to update the target Flash Player from the Publish Settings. 使用Flash CS5,您需要从“发布设置”更新目标Flash Player。 By default it will target up to Flash Player 10.2.
默认情况下,它将最多定位到Flash Player 10.2。
Adobe has a blog regarding Adding Flash Player 11 support to Flash Pro CS5 and CS5.5 . Adobe有一个博客,内容涉及向Flash Pro CS5和CS5.5添加Flash Player 11支持 。
At that page you will find an extension (MXP) install as well as manual instruction of updating Flash Player to 11. 在该页面上,您将找到扩展(MXP)安装以及将Flash Player更新到11的手动说明。
Load CS5 or CS.5 MXP with Adobe Extension Manager, and you will be able to target Flash Player 11.0 from your Publish Settings: 使用Adobe Extension Manager加载CS5或CS.5 MXP,您将能够从“发布设置”中定位Flash Player 11.0:
Note that JSON parse takes an object, and not a path to a file. 请注意,JSON解析采用一个对象,而不是文件的路径。 Your code should give Error #1132: Invalid JSON parse input.
您的代码应提供错误#1132:无效的JSON解析输入。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.