有没有办法在 Flash CS3 应用程序的主 .fla 文件中创建一个类?

发布于 2024-08-04 18:48:25 字数 193 浏览 2 评论 0原文

有没有办法在 Flash 应用程序的主 .fla 文件中创建一个类? 如果我尝试直接在 .fla 的操作层中定义类,则会收到错误:“类不得嵌套”。 或者,如果我尝试定义一个包和其中的类,我会得到“包不得嵌套”。

我知道我可以引用外部 .as 文件作为“文档类”,但我想知道是否有办法将该类直接放入 .fla 中。

谢谢!
佐尔坦

is there a way to create a class inside the main .fla file of a flash application?
If I try to define a class directly in the action layer of the .fla, I get the error: "classes must not be nested".
Alternatively, if I try to define a package and the class inside, I get "packages must not be nested".

I know I can reference an external .as file as the "Document class" but I was wondering if there was a way to put the class directly into the .fla.

Thanks!
Zoltan

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

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

发布评论

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

评论(2

就是爱搞怪 2024-08-11 18:48:25

类必须使用 .as 文件中的包进行定义,并且文件名与类完全相同

// Filename: MyClass.as
package {
    public class MyClass {
    }
}

Classes must be defined with a package in .as files with the exact filename as the class

// Filename: MyClass.as
package {
    public class MyClass {
    }
}
内心旳酸楚 2024-08-11 18:48:25

您无法在时间轴中创建课程。 Flash 编译器将时间线视为类本身,并且您不能在类中嵌套类。

You can not create a class in the timeline. The Flash compiler treats the timeline as a class itself and you can not nest classes within classes.

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