Flash动画外文文献word版本
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
F l a s h动画外文文献
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 teachers' teaching efficiency, also can add vivid artistic effect courseware, conduce to the academic knowledge expression and communication. In order to provide students with intuitive experimental process, improve their learning efficiency and flash animation in the teaching application is necessary. This paper to make proteins dialysis animation as an example, introduced simply have strong ability and unique interactive Flash8.0, discusses how to use the Flash8.0 make protein dialysis experimental animation whole process and related matters.
What is Flash
Flash is an authoring tool that lets designers and developers create presentations, applications, and other content that enables user interaction. Flash projects can include simple animations, video content, complex presentations, applications, and everything in between. In general, individual pieces of content made with Flash are called applications, even though they might only be a basic animation. You can make media-rich Flash applications by including pictures, sound, video, and special effects.
Flash is extremely well suited to creating content for delivery over the Internet because its files are very small. Flash achieves this through its extensive use of vector graphics. Vector graphics require significantly less memory and storage space than bitmap graphics because they are represented by mathematical formulas instead of large data sets. Bitmap graphics are larger because each individual pixel in the image requires a separate piece of data to represent it.
To build an application in Flash, you create graphics with the Flash drawing tools and import additional media elements into your Flash document. Next, you define how and when you want to use each of those elements to create the application you have in mind.
When you author content in Flash, you work in a Flash document file. Flash documents have the file extension .fla. A Flash document has four main parts: The Stage is where your graphics, video, buttons, and so on appear during playback.
The Timeline is where you tell Flash when you want the graphics and other elements of your project to appear. You also use the Timeline to specify the layering order of graphics on the Stage. Graphics in higher layers appear on top of graphics in lower layers.
The Library panel is where Flash displays a list of the media elements in your Flash document.
ActionScript code allows you to add interactivity to the media elements in your document. For example, you can add code that causes a button to display a new image when the user clicks it. You can also use ActionScript to add logic to your applications. Logic enables your application to behave in different ways depending on the user’s actions or other conditions. Flash includes two versions of ActionScript,
each suited to an author’s specific needs. For more information about writing ActionScript, see Learning ActionScript 2.0 in Flash in the Help panel.
Flash includes many features that make it powerful but easy to use, such as prebuilt drag-and-drop user interface components, built-in behaviors that let you easily add ActionScript to your document, and special effects that you can add to media objects.
When you have finished authoring your Flash document, you publish it using the File > Publish command. This creates a compressed version of your file with the extension .swf. You can then play the SWF file in a web browser or as a stand-alone 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 combine 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 complex 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 Internet applications
These include a wide spectrum of applications that provide a rich user interface for displaying and manipulating remotely stored data over the Internet. A rich Internet application could be a calendar application, a price-finding 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 become 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; 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 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; 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 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 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 user’s mouse movements to
reposition elements in the scene.
Frame events
On a main or movie clip Timeline, a system event occurs when the playhead enters a keyframe—this 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 you’ve 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, it’s 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 don’t 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, you’re 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 you’re 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 you’ve stored externally, as shown in the following example:
#include "../core/Functions.as"
You can also use ActionScript 2.0 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 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 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 code-assistance 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.
Flash 动画
在现代教学中,传统的教学已经不能满足现代教学的要求,这对教学方式和教师等都提出了更高的要求,所以对于Flash制作动画课件的研制有着极为重要的意义。
Flash不仅能使学习者加深对所学知识的理解,提高学生的学习兴趣和教师的教学效率,同时也能为课件增加生动的艺术效果,有助于学科知识的表达和传播。
为了为学生提供直观的实验过程,提高学生的学习效率,Flash 动画在教学中的应用十分必要。
本论文以制作蛋白质透析动画为例,阐述了利用拥有强大能力和独特的交互性的Flash8.0制作实验动画的整个过程和有关事宜。
什么是Flash
Flash 是一种创作工具,设计人员和开发人员可使用它来创建演示文稿、应用程序和其它允许用户交互的内容。
Flash 可以包含简单的动画、视频内容、复杂演示文稿和应用程序以及介于它们之间的任何内容。
通常,使用 Flash 创作的各个内容单元称为应用程序,即使它们可能只是很简单的动画。
您可以通过添加图片、声音、视频和特殊效果,构建包含丰富媒体的 Flash 应用程序。
Flash 特别适用于创建通过 Internet 提供的内容,因为它的文件非常小。
Flash 是通过广泛使用矢量图形做到这一点的。
与位图图形相比,矢量图形需要的内存和存储空间小很多,因为它们是以数学公式而不是大型数据集来表示的。
位图图形之所以更大,是因为图像中的每个像素都需要一组单独的数据来表示。
要在 Flash 中构建应用程序,可以使用 Flash 绘图工具创建图形,并将其它媒体元素导入 Flash 文档。
接下来,定义如何以及何时使用各个元素来创建设想中的应用程序。
在Flash 中创作内容时,需要在 Flash 文档文件中工作。
Flash 文档的文件扩展名为 .fla (FLA)。
Flash 文档有四个主要部分:
舞台是在回放过程中显示图形、视频、按钮等内容的位置。
时间轴用来通知 Flash 显示图形和其它项目元素的时间,也可以使用时间轴指定舞台上各图形的分层顺序。
位于较高图层中的图形显示在较低图层中的图形的上方。
库面板是 Flash 显示 Flash 文档中的媒体元素列表的位置。
ActionScript 代码可用来向文档中的媒体元素添加交互式内容。
例如,可以添加代码以便用户在单击某按钮时显示一幅新图像,还可以使用 ActionScript 向应用程序添加逻辑。
逻辑使应用程序能够根据用户的操作和其它情况采取不同的工作方式。
Flash 包括两个版本的 ActionScript,可满足创作者的不同具体需要。
有关编写ActionScript 的详细信息,请参阅“帮助”面板中的“学习 Flash 中的 ActionScript 2.0”。
Flash 包含了许多种功能,如预置的拖放用户界面组件,可以轻松地将ActionScript 添加到文档的内置行为,以及可以添加到媒体对象的特殊效果。
这些功能使 Flash 不仅功能强大,而且易于使用。
完成 Flash 文档的创作后,可以使用“文件”“发布”命令发布它。
这会创建文件的一个压缩版本,其扩展名为 .swf (SWF)。
然后,就可以使用 Flash Player 在Web 浏览器中播放 SWF 文件,或者将其作为独立的应用程序进行播放。
使用Flash可以做什么
使用 Flash 中的诸多功能,可以创建许多类型的应用程序。
以下是 Flash 能够生成的应用程序种类的一些示例:
动画包括横幅广告、联机贺卡、卡通画等。
许多其它类型的 Flash 应用程序也包含动画元素。
游戏许多游戏都是使用 Flash 构建的。
游戏通常结合了 Flash 的动画功能和 ActionScript 的逻辑功能。
用户界面许多 Web 站点设计人员使用 Flash 设计用户界面。
它可以是简单的导航栏,也可以是复杂得多的界面。
灵活消息区域设计人员使用 web 页中的这些区域显示可能会不断变化的信息。
餐厅 Web 站点上的灵活消息区域 (FMA) 可能显示每天的特价菜单。
丰富 Internet 应用程序这包括多种类别的应用程序,它们提供丰富的用户界面,用于通过 Internet 显示和操作远程存储的数据。
丰富 Internet 应用程序可以是一个日历应用程序、价格查询应用程序、购物目录、教育和测试应用程序,或者任何其它使用丰富图形界面提供远程数据的应用程序。
根据您的项目和工作方式,您可以按不同的顺序使用上述步骤。
随着对Flash 及其工作流程的不断熟悉,您会发现一种最适合自己的工作方式。
关于 ActionScript 和事件
在 Macromedia Flash Basic 8 和 Macromedia Flash Professional 8 中,事件发生时会执行 ActionScript 代码:例如,在加载影片剪辑时、在进入时间轴上的关键帧时或者在用户单击某个按钮时。
事件可以由用户或系统触发。
用户单击
鼠标按钮或按键;在满足特定条件或进程完成(SWF 文件加载、时间轴到达特定的帧、图形完成下载等)时,系统会触发相关事件。
事件发生时,您应编写一个事件处理函数,从而在该事件发生时让一个动作响应该事件。
了解事件发生的时间和位置将有助于您确定在什么位置、以什么样的方式用一个动作响应该事件,以及在各种情况下分别应该使用哪些ActionScript 工具。
事件可以划分为以下几类:鼠标和键盘事件,发生在用户通过鼠标和键盘与 Flash 应用程序交互时;剪辑事件,发生在影片剪辑内;帧事件,发生在时间轴上的帧中。
鼠标和键盘事件
用户与 SWF 文件或应用程序交互时触发鼠标和键盘事件。
例如,当用户滑过一个按钮时,将发生 Button.onRollOver 或 on(rollOver) 事件;当用户单击某个按钮时,将发生 Button.onRelease 事件;如果按下键盘上的某个键,则发生on(keyPress) 事件。
可在帧上编写代码或向实例附加脚本,以处理这些事件以及添加所需的所有交互操作。
剪辑事件
在影片剪辑中,您可以响应用户进入或退出场景或使用鼠标或键盘与场景进行交互时触发的多个剪辑事件。
例如,可以在用户进入场景时将外部 SWF 文件或 JPG 图像加载到影片剪辑中,或允许用户使用移动鼠标的方法在场景中调整元素的位置。
帧事件
在主时间轴或影片剪辑时间轴上,当播放头进入关键帧时会发生系统事件 -- 这叫做帧事件。
帧事件可用于根据时间的推移(沿时间轴移动)触发动作或与
舞台上当前显示的元素交互。
如果向一个关键帧中添加了一个脚本,则在回放期间到达该关键帧时将执行该脚本。
附加到帧上的脚本称为帧脚本。
帧脚本最常见的一种用法是在到达特定的关键帧后停止回放。
这是使用stop() 函数实现的。
您可以选择一个关键帧,然后将 stop() 函数作为脚本元素添加到动作面板中。
将 SWF 文件停止在特定的关键帧后,您需要执行某种动作。
例如,可以使用帧脚本来动态更新某个标签的值、管理舞台上各元素的交互等等。
组织 ActionScript 代码
您可以将脚本附加到关键帧和对象实例(影片剪辑、按钮和其它元件)中。
但是,如果您的 ActionScript 代码散布于多个关键帧和对象实例中,调试您的应用程序将非常困难。
另外,这还会导致难于在不同的 Flash 应用程序之间共享代码。
因此,在 Flash 中创建 ActionScript 时遵循编码最佳做法是非常重要的。
不要将脚本附加到关键帧、影片剪辑和按钮这些元素中,而应通过调用一些驻留在一个中心位置的函数来响应事件。
一种办法是,尽可能将嵌入的ActionScript 附加到时间轴的第一帧或第二帧,这样您就不必搜索 FLA 文件来查找所有代码了。
常见的做法是创建一个名为动作的图层,并将 ActionScript 代码放置在该图层上。
在将所有脚本附加到各个元素时,同时也会将所有代码嵌入到 FLA 文件中。
如果在其它 Flash 应用程序之间共享代码对您来说很重要,请使用"脚本"窗口或您最喜爱的文本编辑器来创建一个外部 ActionScript (AS) 文件。
通过创建外部文件,您的代码将更加模块化,组织结构也更好。
随着项目的扩展,这种简便性带来的好处将超出您的想像。
如果您在与其他开发人员共同开发一个项目,外部文件还有助于进行调试和源文件控制管理。
若要使用外部 AS 文件中包含的 ActionScript 代码,您可以在 FLA 中创建一个脚本,然后使用 #include 语句来访问存储在外部的代码,如下例所示:#include “../core/Functions.as”
您还可以使用 ActionScript 2.0 来创建自定义类。
您必须将自定义类存储在外部 AS 文件中,并在脚本中使用 import 语句来使类导出到 SWF 文件中,而不要使用 #include 语句。
还可以使用组件(预构建的影片剪辑)共享代码和功能,例如 UI 元素和脚本。
关于通过编写脚本来处理事件
编写事件代码可以分为两大类:在时间轴上(在关键帧中)发生的事件和在对象实例(影片剪辑、按钮和组件)上发生的事件。
SWF 文件或应用程序的交互可以散布于项目中的多个元素中,您可能很想试一试直接将脚本添加给这些元素。
但是,Macromedia 建议不要直接将脚本添加给这些元素(关键帧和对象)。
您应该转而通过调用驻留在一个中心位置的函数来响应事件。
使用"动作"面板和"脚本"窗口
若要在 FLA 文件中创建脚本,可以直接将 ActionScript 输入"动作"面板。
若要创建包含或导入到应用程序中的外部脚本,可以使用“脚本”窗口(选择“文件”“新建”,再选择ActionScript 文件)或您喜爱的文本编辑器。
使用"动作"面板或"脚本"窗口时,实际上是在使用 ActionScript 编辑器的功能编写、格式化和编辑代码。
"动作"面板和"脚本"窗口都具有"脚本"窗格(在其
中键入代码)和"动作"工具箱。
除了"脚本"窗口的代码帮助功能之外,动作面板还提供了一些其它功能。
Flash 在“动作面板中提供这些功能是因为它们在FLA 文件中编辑 ActionScript 的上下文时特别有用。