Flash动画外文翻译.doc_第1页
Flash动画外文翻译.doc_第2页
Flash动画外文翻译.doc_第3页
Flash动画外文翻译.doc_第4页
Flash动画外文翻译.doc_第5页
已阅读5页,还剩10页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

中原工学院信息商务学院毕业设计(论文)译文专用纸 第15页内部资料仅供参考a&ue9aqgn8xp$r# the system triggers events when specific conditions are met or processes completed (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; clip events, which occur within movie clips; and frame events, which occur within frames on the timeline. mouse and keyboard eventsa 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; when a button is clicked, the on (press) event occurs; 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 eventswithin 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 the mouse or keyboard. you might, for example, load an external swf file or jpg image into the movie clip when the user enters the scene, or allow the users mouse movements to reposition elements in the scene. frame eventson a main or movie clip timeline, a system event occurs when the playhead enters a keyframethis is known as a frame event. frame events are useful for triggering actions based on the passage of time (moving through the timeline) or for interacting with elements that are currently visible on the stage. when you add a script to a keyframe, it is executed when the keyframe is reached during playback. a script attached to a frame is called a frame script. one of the most common uses of frame scripts is to stop the playback when a certain keyframe is reached. this is done with the stop() function. you select a keyframe and then add the stop() function as a script element in the actions panel.once youve stopped the movie at a certain keyframe, you need to take some action. you could, for example, use a frame script to dynamically update the value of a label, to manage the interaction of elements on the stage, and so on. for more information, see chapter 5, “handling events,” on page #.organizing actionscript code you may attach scripts to keyframes and to object instances (movie clips, buttons, and other symbols). however, if your actionscript code is scattered over many keyframes and object instances, debugging your application will be much more difficult. it will also be impossible to share your code between different flash applications. therefore, its important to follow best practices for coding when you create actionscript in flash. rather than attaching your scripts to elements like keyframes, movie clips, and buttons, you should respond to events by calling functions that reside in a central location. one method is to attach embedded actionscript to the first or second frame of the timeline whenever possible so you dont have to search through the fla file to find all your code. a common practice is to create a layer called actions and place your actionscript code there. when you attach all your scripts to individual elements, youre embedding all your code in the fla file. if sharing your code between other flash applications is important to you, use the script window or your favorite text editor to create an external actionscript (as) file. by creating an external file, you make your code more modular and well organized. as your project grows, this convenience becomes much more useful than you might imagine. an external file aids debugging and also source control management if youre working on a project with other developers.to use the actionscript code contained in an external as file, you create a script within the fla file and then use the #include statement to access the code youve stored externally, as shown in the following example:#include ./core/functions.asyou can also use actionscript 2.0 to create custom classes. you must store custom classes in external asfiles 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 components 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 recommends 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 acti

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论