Flash 错误 #1034:使用 Flash Develop 运行时类型强制失败

发布于 2024-10-06 06:58:52 字数 582 浏览 0 评论 0原文

我已经编译了一个 SWC 并在 flashdevelop 项目中使用它。

当我编译项目时,一切都很好,但是当我运行/调试项目时,我得到:

[Fault] exception, information=TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@43e3f99 to fl.controls.Button.

以下行导致了错误:

public var loginPanel:loginControl  = new loginControl();  

LoginControlView 是影片剪辑名称。 loginControlView 是资产名称。 并且有一个名为 LoginControl 的类,它扩展了 loginControlView

LoginControlView 影片剪辑包含 2 个文本框和一个按钮 (fl.controls)

如果我从 Flash IDE 编译/运行/调试,该项目运行正常。

有什么建议吗?

I have compiled an SWC and am using it in a flashdevelop project.

When I compile the project all is fine, but when I run/debug the project I get:

[Fault] exception, information=TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@43e3f99 to fl.controls.Button.

The following line is causing the fault:

public var loginPanel:loginControl  = new loginControl();  

LoginControlView is the movieclip name.
loginControlView is the asset name.
and there is a class called loginControl that extends loginControlView

The LoginControlView movieclip contains 2 textboxes and a button (fl.controls)

The project runs fine if I compile/run/debug from the Flash IDE.

Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

等往事风中吹 2024-10-13 06:58:52

好吧,我找到了解决方案。我的类路径中包含 Flash 安装的 fl.controls 文件夹的路径。但 fl.controls 也与我的 SWC 一起导出。
我认为同一类的两个定义导致了问题,因为当我删除类路径时,一切都工作正常。

Ok I found a solution. Included in my classpaths was a path to the fl.controls folder of the flash install. But the fl.controls where also being exported with my SWC.
I assume having two definitions of the same class was causing the problem, because when I removed the classpath all worked fine.

庆幸我还是我 2024-10-13 06:58:52

您可能知道,fl.controls 包包含 Flash Professional CS5 及更早版本的组件,可以通过将组件捆绑在 .swc 中来在 Flash 开发中使用这些组件:如何在 FlashDevelop 中使用 fl.controls.* 中的 Adob​​e 控件?

由于您的项目在 Flash Professional 中编译没有错误,因此问题必定出在导出的 fl.controls.* .swc 中。

由于您使用的是 Flash Develop,因此您可以使用 spark.controls 包mx.controls 包。这两个包都包含 Button 和 TextInput 类。

as you probably know, fl.controls package contains components for Flash Professional CS5 and earlier which can be used in Flash Develop by bundling the components in a .swc: How do I use an Adobe control from fl.controls.* in FlashDevelop?

since your project compiles in Flash Professional without error the problem must lie within the exported fl.controls.* .swc.

instead of using an fl.contros.* .swc, since you're using Flash Develop, you could use the spark.controls package or mx.controls package from the Flex 4.1 SDK. both packages include a Button and TextInput classes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文