在 ActionScript 3 (flash pro CS5.5) 中运行 hello world 应用程序
我正在自学 ActionScript 3,我阅读了一些教程并完全理解了代码,问题在于如何运行它,我知道一些编程语言并且多年来我使用了一些 IDE,但由于某种原因我就是不能'不知道如何在 CS5.5 中编译和运行简单的 ActionScript 程序。
谁能告诉我如何使用 flash pro CS5.5 来完成此操作,是否有另一个更类似于 netbeans 或 eclipse 的程序,我可以编写动作脚本并运行它们?
谢谢
Am self teaching myself actionscript 3, I read through some tutorials and understood the code perfectly, the problem lies in how to run it, I know some programming languages and I used some IDEs i over the years, but for some reason I just can't figure out how to compile and run simple actionscript programs in CS5.5.
Can anyone please tell me how this can be done with flash pro CS5.5, is there another program more akin to netbeans or eclipse that I can write actionscripts and run them??
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您缺少的是将 .as 文件绑定到 .fla 中以用作主文件或文档类的能力。
您可以在 .fla 文件的属性面板中设置文档类。
作为快速示例:
1) 创建一个名为 MyDocumentClass.as 的文件,它应该是一个非常简单的 AS3 类文件。类名称为 MyDocumentClass。看起来应该是这样的:
到目前为止还好吗?
2) 现在打开Flash CS5.5并创建一个新的.fla。将该 .fla 保存在保存文档类的同一文件夹中。舞台上应该没有任何东西 - 找到属性面板。应该有一个带有“文档类”标签的文本输入框 - 只需在该文本字段中输入“MyDocumentClass”,然后编译您的 .fla。您应该得到“成功了!”查出。
基本上,当您正在开发基于 AS3 的复杂应用程序但想要使用 Flash IDE 来处理图形或其他内容时,您的工作是将符号链接到库中的类。整个 FLA 的类是文档类,这就是您在整个 .fla 的属性面板中链接它的原因。
当您开始使用 CS5 时,您最终将开始创建位于库中的影片剪辑。您可以随时右键单击其中之一并查看您的属性。选择“高级”,您应该会看到“导出为 AS3”选项 - 单击该选项,然后您就可以使该符号扩展基类或简单地绑定到一个类中。一旦您开始使用它,它就应该开始变得有意义 - 不过,希望上面的步骤 1 和 2 足以让您上手。
祝你好运,玩得开心!
The piece you're missing is the ability to tie an .as file into an .fla to serve as the main, or Document, Class.
You can set the Document Class in the properties panel of an .fla file.
For a quick sample:
1) Create a file called MyDocumentClass.as, which should be a pretty simple AS3 class file. The class name would be MyDocumentClass. That should look something like this:
So far so good?
2) Now open Flash CS5.5 and create a new .fla. Save that .fla in the same folder that you saved your Document Class. You should have nothing on the stage - find the properties panel. There should be a text input box with the label "Document Class" - simply type "MyDocumentClass" into that text field, then compile your .fla. You should get "It worked!" traced out.
Basically, when you're working on a complex AS3-based application but want to use the Flash IDE for graphics or whatever, your job is to link up symbols to classes in the library. The class for the whole FLA is the Document Class, which is why you link that up in the properties panel for the whole .fla.
When you are rolling in CS5, you will eventually start creating MovieClips that live in your library. You can right-click one of those at any time and look at your properties. Select "advanced" and you should get the option to "export for AS3" - click that, then you can make it so that that symbol either extends a base class or simply ties into a class. Once you start playing with it it should start to make sense - hopefully, though, steps 1 and 2 above will be enough to get you rolling.
Good luck and have fun!
跳过教程。每个 AS 开发人员都应该拥有一份 Essential ActionScript 3.0 的副本。阅读它,并在您的环境中完成示例。
虽然我喜欢 FlashDevelop,但我认为 Flash IDE 并不像大多数人所说的那么糟糕。我发现在开发的早期阶段,仅使用 IDE 会快得多,尤其是当我从图形人员那里获得了粗略的 FLA,并且我在库中需要完成大量课堂作业,并且必须重新设计结构以更好地满足需求时。不过,我承认,自从我学会了如何在不使用 IDE 的情况下进行编程之后,我的观点就有点偏颇了。
Skip the tutorials. Every AS developer should have a copy of Essential ActionScript 3.0. Read it, and work through the examples in your environment.
While I like FlashDevelop, I don't think the Flash IDE is as bad as most say it is. I find it a lot quicker in early stages of development to just use the IDE, especially when I have a rough FLA from a graphics person and I have lots of class assignments to make in the library, and have to rework structure to better fit requirements. I will admit, though, that since I learned how to program w/o an IDE, my opinion is a bit skewed.