十分钟倒计时flash_Flash 101-第6部分:最终倒计时
十分鐘倒計(jì)時(shí)flash
音樂(lè)的聲音 (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.
好吧,我們快要結(jié)束這個(gè)狂叫了,我想稱(chēng)之為Flash101。如果您一直沿用 ,您可能會(huì)松一口氣,本教程即將結(jié)束,現(xiàn)在您可以開(kāi)始學(xué)習(xí)了實(shí)際使用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.
但是,速度不是很快-我還有幾分鐘的時(shí)間,我打算全部使用它們。 在本文的最后一篇文章中,我將教您如何通過(guò)添加聲音片段,循環(huán)播放,同步它們以及使其淡入和淡出來(lái)使動(dòng)畫(huà)更加生動(dòng)有趣。 我還將向您展示如何將聲音附加到Flash按鈕,以及如何將圖像從其他應(yīng)用程序?qū)隖lash。
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.
正如您可以創(chuàng)建符號(hào)并一遍又一遍地使用它們一樣,Flash允許您將聲音文件導(dǎo)入庫(kù)中,并在Flash電影的不同位置使用它們。 您可以通過(guò)文件->導(dǎo)入命令以WAV和MP3格式導(dǎo)入聲音文件。 將聲音文件導(dǎo)入Flash電影后,它將顯示在“資源庫(kù)”中。
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電影本身就是簡(jiǎn)單的操作-創(chuàng)建一個(gè)新層,選擇要開(kāi)始播放聲音的幀,然后將聲音文件從“庫(kù)”拖到舞臺(tái)上。 波形的圖形表示將出現(xiàn)在時(shí)間軸中。
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電影中添加任意數(shù)量的聲音文件; 但是請(qǐng)記住,在播放最終電影時(shí),所有這些聲音文件都會(huì)混合在一起。 將每個(gè)聲音文件放在單獨(dú)的層上也是一個(gè)好主意,這樣您就可以輕松地操縱電影中的各種文件。
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.
您可以通過(guò)窗口->面板->聲音面板來(lái)控制聲音片段的屬性,或?yàn)槠涮砑有Ч?選擇包含聲音片段的框架后,彈出以打開(kāi)此面板,并查看可用的選項(xiàng)。
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.
可用的各種選項(xiàng)中最重要的是“同步”選項(xiàng)-它使您可以指定聲音文件是否與動(dòng)畫(huà)的其余部分同步。 要將聲音片段與動(dòng)畫(huà)的不同幀同步,請(qǐng)選擇“流”選項(xiàng)。 流式聲音在下載時(shí)開(kāi)始播放,并自動(dòng)在電影結(jié)尾處停止。
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.
相反,如果您希望聲音片段獨(dú)立于動(dòng)畫(huà)在整個(gè)電影中播放,請(qǐng)選擇“事件”選項(xiàng)。 在這種情況下,聲音片段的播放與時(shí)間軸中的幀無(wú)關(guān),甚至在電影結(jié)束后仍可能繼續(xù)播放。 “事件”選項(xiàng)最常用于將聲音鏈接到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.
如果您希望聲音片段播放不止一次,則可以在“循環(huán)”字段中輸入數(shù)字,還可以使用“效果”下拉菜單添加聲音效果,例如淡入淡出和頻道切換。
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.
最后,您可以通過(guò)在聲音層中的某個(gè)點(diǎn)插入關(guān)鍵幀,然后從該關(guān)鍵幀的“同步”菜單選項(xiàng)中選擇“停止”,來(lái)停止特定點(diǎn)的聲音。
Copyright Melonfire, 2000. All rights reserved.
版權(quán)所有Melonfire ,2000。保留所有權(quán)利。
聲音叮咬 (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.
如果預(yù)定義的Flash音效不夠,還可以使用Flash的內(nèi)置編輯控件來(lái)進(jìn)一步自定義聲音片段。 這些編輯控件可通過(guò)“聲音”面板中的“編輯”命令使用。
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.
這看起來(lái)很復(fù)雜,但實(shí)際上比看起來(lái)簡(jiǎn)單得多。 例如,要更改聲音剪輯開(kāi)始和停止播放的點(diǎn),您只需要將Time In和Time Out控件(左右聲道波形之間的垂直灰色條)拖動(dòng)到適當(dāng)?shù)狞c(diǎn)。 如果您有一個(gè)較長(zhǎng)的聲音剪輯,并且只需要在動(dòng)畫(huà)剪輯中使用它的特定部分,這將特別方便。
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.
您也可以通過(guò)上下拖動(dòng)“信封手柄”(在每個(gè)通道中看到的空心框)來(lái)更改每個(gè)通道的音量。 兩個(gè)盒子之間的高度越大,音量越高,反之亦然。 Flash使您可以為每個(gè)聲音剪輯創(chuàng)建多達(dá)八對(duì)不同的包絡(luò)線手柄。
繁榮! (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.
除了在電影運(yùn)行時(shí)播放聲音文件外,Flash還允許您響應(yīng)用戶的操作來(lái)播放聲音。 最常見(jiàn)的示例是將聲音文件附加到Flash按鈕,以便根據(jù)按鈕狀態(tài)播放不同的聲音。 看一下此示例,該示例演示了如何為“懸停”和“單擊”事件播放不同的剪輯。
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.
我是怎么做到的? 實(shí)際上,并不太難–在符號(hào)編輯模式下,創(chuàng)建一個(gè)Flash按鈕,并在時(shí)間軸中添加一個(gè)新圖層。 然后,只需在此新層上插入與“上”,“上”和“下”狀態(tài)相對(duì)應(yīng)的關(guān)鍵幀,然后針對(duì)每種狀態(tài)從“庫(kù)”中拖動(dòng)不同的聲音文件即可。
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.
例如,如果希望當(dāng)鼠標(biāo)指針移到按鈕上時(shí)播放特定的聲音,則可以為“ Over”狀態(tài)插入新的關(guān)鍵幀,然后將聲音文件拖到該關(guān)鍵幀的舞臺(tái)上。
Make sure that you have Event selected for the Sync option on the Sound panel, and try it out.
確保在“聲音”面板上為“同步”選項(xiàng)選擇了“事件”,然后嘗試一下。
You can add sound effects, and manipulate the sound clip with the editing control, here too.
您也可以在此處添加聲音效果,并使用編輯控件來(lái)操作聲音片段。
擠進(jìn)去 (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.
發(fā)布影片時(shí),Flash通常會(huì)導(dǎo)出影片剪輯中的所有聲音。 作為電影的作者,您可以對(duì)導(dǎo)出過(guò)程進(jìn)行大量控制,包括可以設(shè)置各種壓縮選項(xiàng)(如采樣率和質(zhì)量)的能力。
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.
所有這些選項(xiàng)在“聲音屬性”對(duì)話框中都可用,您可以從右鍵單擊“庫(kù)”中的聲音文件時(shí)出現(xiàn)的“屬性”快捷菜單中進(jìn)入。 共有四個(gè)壓縮選項(xiàng):默認(rèn)(默認(rèn)設(shè)置),ADPCM,MP3和原始(無(wú)壓縮)。 測(cè)試按鈕可讓您使用選定的壓縮設(shè)置預(yù)覽聲音片段。
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.
一些壓縮選項(xiàng)允許您指定比特率和質(zhì)量-請(qǐng)記住,嘗試這些設(shè)置時(shí),較高的壓縮率等于較小的文件等于較低的質(zhì)量。
Copyright Melonfire, 2000. All rights reserved.
版權(quán)所有Melonfire ,2000。保留所有權(quán)利。
來(lái)自其他地方的漂亮圖片 (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.
除了導(dǎo)入聲音片段,Flash還允許您導(dǎo)入在其他應(yīng)用程序中創(chuàng)建的圖像,并將其用于Flash電影中。 Flash 5支持Adobe Illustrator EPS文件,AutoCAD DXF文件,位圖,GIF,JPEG,PNG圖像以及其自己的SWF格式-所有這些都可以通過(guò)“文件”->“導(dǎo)入”命令導(dǎo)入到Flash中。 導(dǎo)入的圖像會(huì)與您創(chuàng)建的其他符號(hào)一起顯示在資源庫(kù)中。
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命令將導(dǎo)入的位圖轉(zhuǎn)換為更有效的矢量圖形。
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.
“跟蹤位圖”命令完全按照名稱(chēng)的含義進(jìn)行操作–跟蹤位圖圖像和顏色,以矢量格式創(chuàng)建精確的渲染。 通常,最終的矢量圖像缺乏原始的保真度,但仍可以在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還可以通過(guò)指定諸如顏色閾值(是否將具有相同顏色值的像素視為相同)和曲線擬合(曲線的平滑度)之類(lèi)的屬性,在某種程度上控制跟蹤過(guò)程。 您必須嘗試不同的值,直到找到適合您特定位圖的設(shè)置。
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.
將位圖轉(zhuǎn)換為矢量圖形后,就可以按照與舞臺(tái)上其他對(duì)象完全相同的方式進(jìn)行操作-將其轉(zhuǎn)換為符號(hào),更改其顏色和形狀,縮放,旋轉(zhuǎn)和傾斜。
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還允許您使用導(dǎo)入的位圖作為填充–為此,請(qǐng)改用Modify-> Break Apart命令。 這會(huì)將位圖分解為單獨(dú)的顏色段。 接下來(lái),選擇“吸管”工具,您應(yīng)該在可用填充列表中看到分開(kāi)的位圖。 選擇填充,然后使用繪圖和繪畫(huà)工具對(duì)該填充進(jìn)行繪圖和繪制。 下面的示例演示了使用位圖填充來(lái)填充橢圓。
風(fēng)景路線 (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.
按照百老匯的最佳傳統(tǒng),Flash允許您將電影分為“場(chǎng)景”,獨(dú)立的序列,然后依次播放。 當(dāng)您需要將Flash電影分為不同的部分時(shí),場(chǎng)景會(huì)派上用場(chǎng)。
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.
您可以通過(guò)窗口->面板->場(chǎng)景面板添加新場(chǎng)景; 如果您需要從電影中刪除場(chǎng)景或更改場(chǎng)景的播放順序,這也是一個(gè)去處。
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(特別是“轉(zhuǎn)到”動(dòng)作)通過(guò)響應(yīng)用戶輸入跳轉(zhuǎn)到特定場(chǎng)景來(lái)增加影片的交互性。
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電影共享在一個(gè)Flash電影中創(chuàng)建的符號(hào),這種功能稱(chēng)為“共享庫(kù)”。 為此,必須通過(guò)導(dǎo)出來(lái)標(biāo)記要共享的符號(hào)。 您可以通過(guò)右鍵單擊符號(hào)時(shí)出現(xiàn)的快捷菜單上的“鏈接”菜單命令來(lái)執(zhí)行此操作。 切記還包括該符號(hào)的標(biāo)識(shí)符。
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.
以這種方式導(dǎo)出所有共享符號(hào)后,即可保存Flash電影-共享庫(kù)將與之一起存儲(chǔ)。 現(xiàn)在,您可以通過(guò)File-> Open As Shared Library命令打開(kāi)該Flash影片中任何其他影片中的符號(hào)。 打開(kāi)共享庫(kù)后,您可以像往常一樣通過(guò)將符號(hào)拖到舞臺(tái)上來(lái)使用它們。
Note, however, that shared libraries typically appear in a dull gray colour, indicating that you cannot modify the symbols contained within them.
但是請(qǐng)注意,共享庫(kù)通常以暗灰色顯示,表明您無(wú)法修改其中包含的符號(hào)。
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.
當(dāng)發(fā)布包含共享庫(kù)中的符號(hào)的Flash電影時(shí),必須確保共享庫(kù)也可用于該電影。 如果Flash無(wú)法找到共享庫(kù),則Flash影片將無(wú)法正確播放。
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.
到此為止。 希望您現(xiàn)在對(duì)Flash有足夠的了解,可以開(kāi)始將Flash用于自己的動(dòng)畫(huà)剪輯和Web效果。 如果您想了解更多信息,或者想了解更多有關(guān)ActionScript和高級(jí)Flash技術(shù)的信息,請(qǐng)寫(xiě)信給我,我會(huì)看到可以做什么。
‘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上進(jìn)行了測(cè)試。 示例僅是說(shuō)明性的,并不意味著用于生產(chǎn)環(huán)境。 YMMV! 版權(quán)所有Melonfire ,2000。保留所有權(quán)利。
翻譯自: https://www.sitepoint.com/flash-101-6-final-countdown/
十分鐘倒計(jì)時(shí)flash
總結(jié)
以上是生活随笔為你收集整理的十分钟倒计时flash_Flash 101-第6部分:最终倒计时的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 地方旅游网站源码,PHP开源,PC+WA
- 下一篇: 新萝卜家园 GhostXP SP3 一键