十分钟倒计时flash

tech2024-06-03  71

十分钟倒计时flash

音乐的声音 (The Sound Of Music)

Well, we’re almost at the end of this wild ride I like to call Flash 101. If you’ve been following along, you’re probably heaving a sigh of relief that this tutorial is almost over, and you can now get down to actually working with Flash 5.

好吧,我们快要结束这个狂叫了,我想称之为Flash101。如果您一直沿用 ,您可能会松一口气,本教程即将结束,现在您可以开始学习了实际使用Flash 5。

Not so fast, though – I still have a few minutes left, and I intend to use them all. In this, the concluding article, I’m going to teach you how to jazz up your animation by adding sound clips, looping them, syncing them and fading them in and out. I’ll also show you how to attach sounds to your Flash buttons, and how to import images from other applications into Flash.

但是,速度不是很快-我还有几分钟的时间,我打算全部使用它们。 在本文的最后一篇文章中,我将教您如何通过添加声音片段,循环播放,同步它们以及使其淡入和淡出来使动画更加生动有趣。 我还将向您展示如何将声音附加到Flash按钮,以及如何将图像从其他应用程序导入Flash。

Don’t go anywhere!

不要去任何地方!

海浪 (The Wave)

Just as you can create symbols and use them over and over again, Flash allows you to import sound files into the Library and use them at different places in your Flash movie. You can import sound files in WAV and MP3 format via the File -> Import command. Once you’ve imported a sound file into your Flash movie, it will show up in the Library.

正如您可以创建符号并一遍又一遍地使用它们一样,Flash允许您将声音文件导入库中,并在Flash电影的不同位置使用它们。 您可以通过文件->导入命令以WAV和MP3格式导入声音文件。 将声音文件导入Flash电影后,它将显示在“资源库”中。

Adding a sound file to your Flash movie is simplicity itself – create a new layer, select the frame where you would like the sound to begin playing, and drag the sound file from the Library on to the Stage. A graphical representation of the waveform will appear in the Timeline.

将声音文件添加到Flash电影本身就是简单的操作-创建一个新层,选择要开始播放声音的帧,然后将声音文件从“库”拖到舞台上。 波形的图形表示将出现在时间轴中。

Flash allows you to add as many sound files as you like to Flash movie; keep in mind, however, that all these sound files are mixed together when the final movie is played back. It’s also a good idea to place each sound file on a separate layer, so that you can easily manipulate the various files in a movie.

Flash允许您向Flash电影中添加任意数量的声音文件; 但是请记住,在播放最终电影时,所有这些声音文件都会混合在一起。 将每个声音文件放在单独的层上也是一个好主意,这样您就可以轻松地操纵电影中的各种文件。

You can control attributes of the sound clip, or add effects to it via the Window -> Panels -> Sound panel. With the frame containing the sound clip selected, pop open this panel and take a look at the options available.

您可以通过窗口->面板->声音面板来控制声音片段的属性,或为其添加效果。 选择包含声音片段的框架后,弹出以打开此面板,并查看可用的选项。

The most important of the various options available is the Sync option – it allows you to specify whether the sound file is synchronized with the rest of the animation or not. To synchronize the sound clip with the different frames of the animation, choose the Stream option. Streamed sounds begin playing while they are downloading, and automatically stop at the end of the movie.

可用的各种选项中最重要的是“同步”选项-它使您可以指定声音文件是否与动画的其余部分同步。 要将声音片段与动画的不同帧同步,请选择“流”选项。 流式声音在下载时开始播放,并自动在电影结尾处停止。

If, instead, you’d prefer your sound clip to play throughout the movie independent of the animation, select the Event option. In this case, the sound clip plays independent of the frames in the Timeline, and may continue even after the movie ends. The Event option is most commonly used to link sounds to a Flash event, such as clicking a button.

相反,如果您希望声音片段独立于动画在整个电影中播放,请选择“事件”选项。 在这种情况下,声音片段的播放与时间轴中的帧无关,甚至在电影结束后仍可能继续播放。 “事件”选项最常用于将声音链接到Flash事件,例如单击按钮。

If you’d like the sound clip to play more than once, you can enter a number into the Loop field, and you can also add sound effects like fades and channel shifts using the Effects drop-down menu.

如果您希望声音片段播放不止一次,则可以在“循环”字段中输入数字,还可以使用“效果”下拉菜单添加声音效果,例如淡入淡出和频道切换。

Finally, you can stop the sound at a specific point by inserting a keyframe at that point in the sound layer, and selecting Stop from the Sync menu option for that keyframe.

最后,您可以通过在声音层中的某个点插入关键帧,然后从该关键帧的“同步”菜单选项中选择“停止”,来停止特定点的声音。

Copyright Melonfire, 2000. All rights reserved.

版权所有Melonfire ,2000。保留所有权利。

声音叮咬 (Sound Bites)

In case the pre-defined Flash sound effects aren’t quite enough, you can also use Flash’s built-in editing controls to further customize the sound clip. These editing controls are available via the Edit command in the Sound panel.

如果预定义的Flash音效不够,还可以使用Flash的内置编辑控件来进一步自定义声音片段。 这些编辑控件可通过“声音”面板中的“编辑”命令使用。

This looks complex, but it’s actually far simpler than it looks. For example, to change the points at which the sound clip starts and stops playing, you simply need to drag the Time In and Time Out controls (the vertical gray bars between the left and right channel waveforms) to the appropriate points. This comes in particularly handy if you have a long sound clip, and only need to use a specific portion of it in your animation clip.

这看起来很复杂,但实际上比看起来简单得多。 例如,要更改声音剪辑开始和停止播放的点,您只需要将Time In和Time Out控件(左右声道波形之间的垂直灰色条)拖动到适当的点。 如果您有一个较长的声音剪辑,并且只需要在动画剪辑中使用它的特定部分,这将特别方便。

You can also change the volume levels for each channel by dragging the "envelope handles" – the hollow boxes you see in each channel – up or down. The greater the height between the two boxes, the higher the volume level, and vice-versa. Flash allows you to create up to eight different pairs of envelope handles for each sound clip.

您也可以通过上下拖动“信封手柄”(在每个通道中看到的空心框)来更改每个通道的音量。 两个盒子之间的高度越大,音量越高,反之亦然。 Flash使您可以为每个声音剪辑创建多达八对不同的包络线手柄。

繁荣! (Boom!)

In addition to playing back sound files as the movie runs, Flash also allows you to play sounds in response to user action. The most common example of this is attaching sound files to Flash buttons, so that a different sound plays depending on button state. Take a look at this example, which demonstrates how you can play a different clip for "hover" and "click" events.

除了在电影运行时播放声音文件外,Flash还允许您响应用户的操作来播放声音。 最常见的示例是将声音文件附加到Flash按钮,以便根据按钮状态播放不同的声音。 看一下此示例,该示例演示了如何为“悬停”和“单击”事件播放不同的剪辑。

How did I do this? Not too hard, actually – create a Flash button, and add a new layer to the Timeline while in symbol-editing mode. Then simply insert keyframes corresponding to the Up, Over and Down states on this new layer, and drag different sound files from the Library for each state.

我是怎么做到的? 实际上,并不太难–在符号编辑模式下,创建一个Flash按钮,并在时间轴中添加一个新图层。 然后,只需在此新层上插入与“上”,“上”和“下”状态相对应的关键帧,然后针对每种状态从“库”中拖动不同的声音文件即可。

For example, if you’d like a specific sound to play when the mouse pointer moves over the button, you could insert a new keyframe for the Over state, and drag a sound file on to the Stage for that keyframe.

例如,如果希望当鼠标指针移到按钮上时播放特定的声音,则可以为“ Over”状态插入新的关键帧,然后将声音文件拖到该关键帧的舞台上。

Make sure that you have Event selected for the Sync option on the Sound panel, and try it out.

确保在“声音”面板上为“同步”选项选择了“事件”,然后尝试一下。

You can add sound effects, and manipulate the sound clip with the editing control, here too.

您也可以在此处添加声音效果,并使用编辑控件来操作声音片段。

挤进去 (Squeezing It All In)

Flash typically exports all the sounds in a movie clip when you publish the movie. As the author of the movie, you have a fair amount of control over the export process, including the ability to set various compression options like sampling rate and quality.

发布影片时,Flash通常会导出影片剪辑中的所有声音。 作为电影的作者,您可以对导出过程进行大量控制,包括可以设置各种压缩选项(如采样率和质量)的能力。

All these options are available to you in the Sound Properties dialog box, which you can get to from the Properties shortcut menu that appears when you right-click the sound file in the Library. There are four compression options available: default (default settings), ADPCM, MP3 and raw (no compression). A test button allows you to preview the sound clip with your selected compression settings.

所有这些选项在“声音属性”对话框中都可用,您可以从右键单击“库”中的声音文件时出现的“属性”快捷菜单中进入。 共有四个压缩选项:默认(默认设置),ADPCM,MP3和原始(无压缩)。 测试按钮可让您使用选定的压缩设置预览声音片段。

Some of the compression options allow you to specify bit rates and quality – remember that higher compression equals smaller files equals lower quality when experimenting with these settings.

一些压缩选项允许您指定比特率和质量-请记住,尝试这些设置时,较高的压缩率等于较小的文件等于较低的质量。

Copyright Melonfire, 2000. All rights reserved.

版权所有Melonfire ,2000。保留所有权利。

来自其他地方的漂亮图片 (Pretty Pictures From Elsewhere)

In addition to importing sound clips, Flash also allows you to import images created in other applications and use them in your Flash movie. Flash 5 has support for Adobe Illustrator EPS files, AutoCAD DXF files, bitmaps, GIFs, JPEGs, PNG images, and its own SWF format – all of these can be imported into Flash via the File -> Import command. Imported images appear in the Library with the other symbols you’ve created.

除了导入声音片段,Flash还允许您导入在其他应用程序中创建的图像,并将其用于Flash电影中。 Flash 5支持Adobe Illustrator EPS文件,AutoCAD DXF文件,位图,GIF,JPEG,PNG图像以及其自己的SWF格式-所有这些都可以通过“文件”->“导入”命令导入到Flash中。 导入的图像会与您创建的其他符号一起显示在资源库中。

Since bitmaps are typically quite large, they can substantially increase the file size of your Flash movie – and so, Flash allows you to convert imported bitmaps into more efficient vector graphics with the Modify -> Trace Bitmap command.

由于位图通常很大,因此它们可以大大增加Flash电影的文件大小-因此,Flash允许您使用Modify-> Trace Bitmap命令将导入的位图转换为更有效的矢量图形。

The Trace Bitmap command does exactly what the name suggests – it traces the bitmap image and colours to create an accurate rendering of it in vector format. Typically, the final vector image lacks the fidelity of the original, but is still acceptable for use on the Web.

“跟踪位图”命令完全按照名称的含义进行操作–跟踪位图图像和颜色,以矢量格式创建精确的渲染。 通常,最终的矢量图像缺乏原始的保真度,但仍可以在Web上使用。

Flash also allows you some degree of control over the trace process, by specifying attributes such as Color Threshold (whether or not to consider pixels with similar color values as the same) and Curve Fit (how smooth curves should be). You’ll have to experiment with different values until you find a setting that works for your specific bitmap.

Flash还可以通过指定诸如颜色阈值(是否将具有相同颜色值的像素视为相同)和曲线拟合(曲线的平滑度)之类的属性,在某种程度上控制跟踪过程。 您必须尝试不同的值,直到找到适合您特定位图的设置。

Once the bitmap has been converted to a vector graphic, you can manipulate it in exactly the same way as you would other objects on the stage – convert it to a symbol, alter its colour and shape, scale it, rotate it, and skew it.

将位图转换为矢量图形后,就可以按照与舞台上其他对象完全相同的方式进行操作-将其转换为符号,更改其颜色和形状,缩放,旋转和倾斜。

Flash also allows you to use imported bitmaps as a fill – to do this, use the Modify -> Break Apart command instead. This will break the bitmap apart into separate segments of colour. Next, select the Eyedropper tool, and you should see the broken-apart bitmap in the list of available fills. Select the fill, and then use the drawing and painting tools to draw and paint with that fill. The following example demonstrates filling an ellipse with a bitmap fill.

Flash还允许您使用导入的位图作为填充–为此,请改用Modify-> Break Apart命令。 这会将位图分解为单独的颜色段。 接下来,选择“吸管”工具,您应该在可用填充列表中看到分开的位图。 选择填充,然后使用绘图和绘画工具对该填充进行绘图和绘制。 下面的示例演示了使用位图填充来填充椭圆。

风景路线 (The Scenic Route)

In the best traditions of Broadway, Flash allows you to divide a movie into "scenes", independent sequences which are played back one after the other. Scenes comes in handy when you need to organize your Flash movie into different sections.

按照百老汇的最佳传统,Flash允许您将电影分为“场景”,独立的序列,然后依次播放。 当您需要将Flash电影分为不同的部分时,场景会派上用场。

You can add a new Scene via the Window -> Panels -> Scene panel; this is also the place to go if you need to remove a scene from the movie, or alter the order in which the scenes are played out.

您可以通过窗口->面板->场景面板添加新场景; 如果您需要从电影中删除场景或更改场景的播放顺序,这也是一个去处。

Flash also allows you to use ActionScript (specifically, the Go To action) to add interactivity to your movie by jumping to specific scenes in response to user input.

Flash还允许您使用ActionScript(特别是“转到”动作)通过响应用户输入跳转到特定场景来增加影片的交互性。

Finally, Flash also allows you to share the symbols you create in one Flash movie with other Flash movies, a capability referred to as "shared libraries". In order to do this, you must mark the symbols you’d like to share by exporting them; you can do this from the Linkage menu command on the shortcut menu that appears when you right-click the symbol. Remember to include an identifier for the symbol as well.

最后,Flash还允许您与其他Flash电影共享在一个Flash电影中创建的符号,这种功能称为“共享库”。 为此,必须通过导出来标记要共享的符号。 您可以通过右键单击符号时出现的快捷菜单上的“链接”菜单命令来执行此操作。 切记还包括该符号的标识符。

Once all shared symbols have been exported in this manner, you can save your Flash movie — the shared library will be stored with it. You can now access the symbols within this Flash movie from any other movie via the File -> Open As Shared Library command. Once a shared library is opened, you can use symbols from it as you normally would, by dragging them on to the Stage.

以这种方式导出所有共享符号后,即可保存Flash电影-共享库将与之一起存储。 现在,您可以通过File-> Open As Shared Library命令打开该Flash影片中任何其他影片中的符号。 打开共享库后,您可以像往常一样通过将符号拖到舞台上来使用它们。

Note, however, that shared libraries typically appear in a dull gray colour, indicating that you cannot modify the symbols contained within them.

但是请注意,共享库通常以暗灰色显示,表明您无法修改其中包含的符号。

When you publish a Flash movie containing symbols from a shared library, you must ensure that the shared library is also available to this movie. If Flash cannot find the shared library, the Flash movie will not play back correctly.

当发布包含共享库中的符号的Flash电影时,必须确保共享库也可用于该电影。 如果Flash无法找到共享库,则Flash影片将无法正确播放。

And that about covers it. Hopefully, you now know enough about Flash to begin using it for your own animation clips and Web effects. If you’d like to read more and perhaps learn a little bit more about ActionScript and advanced Flash techniques, write to me and I’ll see what I can do.

到此为止。 希望您现在对Flash有足够的了解,可以开始将Flash用于自己的动画剪辑和Web效果。 如果您想了解更多信息,或者想了解更多有关ActionScript和高级Flash技术的信息,请写信给我,我会看到可以做什么。

‘Til next time…stay healthy!

直到下一次…保持健康!

Note: All examples in this article have been tested on Macromedia Flash 5.0. Examples are illustrative only, and are not meant for a production environment. YMMV!Copyright Melonfire, 2000. All rights reserved.

注意:本文中的所有示例均已在Macromedia Flash 5.0上进行了测试。 示例仅是说明性的,并不意味着用于生产环境。 YMMV! 版权所有Melonfire ,2000。保留所有权利。

翻译自: https://www.sitepoint.com/flash-101-6-final-countdown/

十分钟倒计时flash

最新回复(0)