【正文】
n of your file with the extension .swf. You can then play the SWF file in a web browser or as a standalone application using Flash Player. What you can do with Flash With the wide array of features in Flash, you can create many types of applications. The following are some examples of the kinds of applications Flash is capable of generating: Animations These include banner ads, online greeting cards, cartoons, and so on. Many other types of Flash applications include animation elements as well. Games Many games are built with Flash. Games usually bine the animation capabilities of Flash with the logic capabilities of ActionScript. User interfaces Many website designers use Flash to design user interfaces. These include simple navigation bars as well as much more plex interfaces. Flexible messaging areas These are areas in web pages that designers use for displaying information that may change over time. A flexible messaging area (FMA) on a restaurant website might display information about each day’ s menu specials. Rich Inter applications These include a wide spectrum of applications that provide a rich user interface for displaying and manipulating remotely stored data over the Inter. A rich Inter application could be a calendar application, a pricefinding application, a shopping catalog, an education and testing application, or any other application that presents remote data with a graphically rich interface. Depending on your project and your working style, you may use these steps in a different order. As you bee familiar with Flash and its workflows, you will discover a style of working that suits you best. About ActionScript and events In Macromedia Flash Basic 8 and Macromedia Flash Professional 8, ActionScript code is executed when an event occurs: for example, when a movie clip is loaded, when a keyframe on the Timeline is entered, or when the user clicks a button. Events can be triggered either by the user or by the system. Users click mouse buttons and press keys。您應該轉而通過調用駐留在一個中心位置的函數(shù)來響應事件。隨著項目的擴展,這種簡便性帶來的好處將超出您的想像。另外,這還會導致難于在不同的 Flash 應用程序之間共享代碼。附加到幀上的腳本稱為幀腳本。 5 鼠標和鍵盤事件 用戶與 SWF 文件或應用程序交互時觸發(fā)鼠標和鍵盤事件。 根據(jù)您的項目和工作方式,您可以按不同的順序使用上述步驟。 游戲 許多游戲都是使用 Flash 構建的。 Flash 包含了許多種功能,如預置的拖放用戶界面組件,可以輕松地將 ActionScript 添加到文檔的內(nèi)置行為,以及可以添加到媒體對象的特殊效果。 時間軸 用來通知 Flash 顯示圖形和其它項目元素的時間,也可以使用時間軸指定舞臺上各圖形的分層順序。Flash 是通過廣泛使用 矢量圖形 做到這一點的。 Flash 不僅能使學習者加深對所學知識的理解,提高學生的學習興趣和教師的教學效率,同時也能為課件增加生動的藝術效果,有助于學科知識的表達和傳播。通常,使用 Flash 創(chuàng)作的各個內(nèi)容單元稱為 應用程序 ,即使它們可能只是很簡單的動畫。 在 Flash 中創(chuàng)作內(nèi)容時,需要在 Flash 文檔文件中工作。邏輯使應用程序能夠根據(jù)用戶的操作和其它情況采取不同的工作方式。 3 使用 Flash 可以做什么 使用 Flash 中的諸多功能,可以創(chuàng)建許多類型的應用程序。餐廳 Web 站點上的靈活消息區(qū)域 (FMA) 可能顯示每天的特價菜單。 事件發(fā)生時,您應編寫一個事件處理函數(shù),從而在該事件發(fā)生時讓一個動作響應該事件。 7 幀事件 在主時間軸或影片剪輯時間軸上,當播放頭進入關鍵幀時會發(fā)生系統(tǒng)事件 這叫做幀事件。例如,可以使用幀腳本來動態(tài)更新某個標簽的值、管理舞臺上各元素的交互等等。 在將所有腳本附加到各個元素時,同時也會將所有代碼嵌入到 FLA 文件中。 9 關于通過編寫腳本來處理事件 編寫事件代碼可以分為兩大類:在時間軸上(在關鍵幀中)發(fā)生的事件和在對象實例(影片剪輯、按鈕和組件)上發(fā)生的事件。除了 腳本 窗口的代碼幫助功能之外,動作面板還提供了一些其它功能。 if a key on the keyboard is pressed, the on (keyPress) event occurs. You can attach scripts to handle these events and add all the interactivity you desire. Clip events Within a movie clip, you may react to a number of clip events that are triggered when the user enters or exits the scene or interacts with the scene using th