【正文】
tionScript to create custom classes. You must store custom classes in external AS files and use import statements in a script to get the classes exported into the SWF file, instead of using include statements. You can also use ponents to share code and functionality. About writing scripts to handle events Events can be categorized into two major groups: those that occur on the Timeline (in keyframes) and those that occur on object instances (move clips, buttons, and other symbols). The interactivity of your Flash movie or application can be scattered over the many elements in your project, and you may be tempted to add scripts directly to these elements. However, Macromedia remends that you do not add scripts directly to these elements (keyframes and objects). Instead, you should respond to events by calling functions that reside in a central location. Using the Actions panel and Script window To create scripts that are part of your document, you enter ActionScript directly into the Actions panel. To create external scripts, you can use the Script window (File New ActionScript File) or your preferred text editor. When you use the Actions panel or Script window, you are using the ActionScript editor. Both the Actions panel and Script window have the Script pane (which is where you use the ActionScript editor) and the Actions toolbox. However, the Actions panel, and the Flash authoring environment in general, offer a few more codeassistance features than the Script window. Flash offers these features in the Actions panel because they are especially useful in the context of editing ActionScript within a FLA file. 。 and frame events, which occur within frames on the Timeline. Mouse and keyboard events A user interacting with your Flash movie or application triggers mouse and keyboard events. For example, when the user rolls over a button, the on (rollOver) event occurs。 the system triggers events when specific conditions are met or processes pleted (the movie loads, the Timeline reaches a certain frame, a graphic finishes downloading, and so on). When an event occurs, you write an event handler to respond to the event with an action. Understanding when and where events occur will help you to determine how and where you will respond to the event with an action, and which ActionScript tools should be used in each case. Events can be grouped into a number of categories: mouse and keyboard events, which occur when a user interacts with your Flash application via the mouse and keyboard。 原文出處 : Flash animation In the modern teaching, the traditional teaching has already cannot satisfy the requirement of modern teaching, the teaching way and teachers etc are put forward higher request, so for the Flash animation courseware development has a very important significance. Flash can not only make the learners to deepen the understanding of the knowledge, improve the learning interest of the students and teachers39。除了 腳本 窗口的代碼幫助功能之外,動(dòng)作面板還提供了一些其它功能。 使用 動(dòng)作 面板或 腳本 窗口時(shí),實(shí)際上是在使用 ActionScript 編輯器的功能編寫、格式化和編輯代碼。 10 使用 動(dòng)作 面板和 腳本 窗口 若要在 FLA 文件中創(chuàng)建腳本,可以直接將 ActionScript 輸入 動(dòng)作 面板。但是, Macromedia 建議不要直接將腳本添加給這些元素(關(guān)鍵幀和對象)。 9 關(guān)于通過編寫腳本來處理事件 編寫事件代碼可以分為兩大類:在時(shí)間軸上(在關(guān)鍵幀中)發(fā)生的事件和在對象實(shí)例(影片剪輯、按鈕和組件)上發(fā)生的事件。您必須將自定義類存儲(chǔ)在外部 AS 文件中,并在腳