简体   繁体   English

我需要导入一些东西才能在AS3中使用JSON吗?

[英]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加载CS5CS.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.

相关问题 我是否需要在 Jmeter 项目中导入任何 Jar 文件才能使用“import groovy.json.*”?? 我该怎么做? - Do I need to import any Jar file in Jmeter project in order to use " import groovy.json.*"?? how should I do that? 什么时候需要使用JSON和XML? - When do I need to use JSON and XML? 为什么我需要在 package.json 上有一个构建脚本才能在 Now 上部署一些东西? 我该如何解决? - Why I need to have an build script on package.json to deploy something on Now? and How can I fix it? Ajax成功需要php JSON对象的支持 - Ajax success need something for php JSON object Json-server-auth,我需要对访问令牌做些什么吗? - Json-server-auth, do I need to do something with access-token? 如何在 Vue 中使用竞争的 function 按字母顺序订购 json? - How do I use a competed function in Vue to order json alphabetically? 如何改善原始JSON数据以使用它? - How can I can improve raw JSON data in order to use it? 我需要从JSON中删除双引号以在NSDictionary中使用 - I need to remove double quotes from JSON for use in NSDictionary 为什么我有时需要使用JSON.stringify,有时候不需要 - Why do I need to use sometimes JSON.stringify and sometimes not 我需要在mysql中使用json数据列的索引 - I need to use index the column of json data in mysql
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM