闪存AS3:的ReferenceError:错误#1056:无法创建属性 [英] Flash AS3: ReferenceError: Error #1056: Cannot create property

查看:611
本文介绍了闪存AS3:的ReferenceError:错误#1056:无法创建属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写的东西在Flash / AS3,我碰到这个问题:

I am writing something in Flash/ AS3, and I came across this problem:

的ReferenceError:错误#1056:无法在package.name.DocumentClasss创造财产txtInput

基本上我有一个文档类,我可以创建影片剪辑的剪辑实例,编译没有问题。但是,当我把一个输入文本字段(调色板中的T图标)在舞台上,并拒绝进行编译,并出现上述错误。

Basically I have a document class, and I can create instances of movieclips clips and compile without issues. But when I put a input text field ("T" icon in the palette) on the stage, and it refuses to compile, with the above error.

我不知道这是否有差别,但我写我的FlashDevelop中ActionScript中,与编辑在Flash IDE中完成的。我也有两个严格模式警告模式选择的发布设置 - >闪光 - >脚本 - >设置... - >错误

I am not sure if this makes a difference, but I am writing my ActionScript in FlashDevelop, with compilation done in the Flash IDE. I also have both Strict Mode and Warnings Mode selected under Publish Settings -> Flash -> Script -> Settings... -> Errors.

我已经寻找解决方案,这个网上,而只是建议在那里似乎是没有插上在Flash IDE雄鹿文本字段,而是动态地在文档类中进行创建。

I have searched for solutions to this online, and the only suggestions out there seem to be to not insert the text field on the stag in Flash IDE, and instead dynamically create them in the document class.

有没有更好的解决办法?

Is there a better solution?

感谢

推荐答案

这听起来像你的如果您要添加自动声明舞台实例的泛滥,因而名为情况下,你需要在你的类声明它

It sounds like you have "Automatically declare stage instances" unchecked and thus if you want to add a named instances, you need to declare it in your class

import flash.text.TextField;
...
public var txtInput:TextField;
...

您可以找到声明舞台实例在影片中的属性闪光灯选项卡设置,点击设置旁边的脚本:ActionScript 3的选择框

You can find the declare stage instances setting in the flash tab in your movie properties and clicking on "settings" next to Script: Actionscript 3 selectbox.

我个人一直有这样的未检查,以便它迫使你声明在你的类的实例,可以更好地跟踪上发生了什么事情。

Personally I always have this unchecked so it forces you to declare the instances in your class and you can better keep track on what's going on.

这篇关于闪存AS3:的ReferenceError:错误#1056:无法创建属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆