More Flash Tips


Sound



Pictures may tell a thousand words but sound adds that extra bit of spice. My first computer hadn't got a sound card but then I got a multimedia kit and never looked back, every time my sound was gone for some reason I used to miss it. Anyway here's how to add sound to Flash Documents. As with the last article, -> means "and then". I am using Flash MX 2004, which I used during my course.

Sound is easy. Start off by either creating a new Flash document and creating your animation or opening a Flash Document you want to add sound to, either way you MUST have a layer with a Motion Tween for this to work. While I'm talking about layers here's a tip, you should name your layers so that you know what each layer contains, you can even create folders for your layers.

To import the sound files goto File -> Import -> Import to library. Where are my sound files you might be asking. Well if you goto Window and select Library you should see a window called Library appear in the bottom right. More than likely it will be covered over, so if you click on it, (I had to do a bit of dragging as well), your sound files should be there. For this example I am using a small MP3.

Now this is the important part, with the red vertical line on the timeline at the end of your Motion Tween, drag the sound file you want onto the stage IN ITS OWN LAYER.

Once that is done you should have at least two layers, one with a Motion Tween arrow, and one with a Waveform. If you have that goto the Property Inspector, (the window down the bottom called Properties), with the sound layer on the timeline selected. On the Property Inspector you should now see information about your sound file and also a drop-down box called "Sync".

This Sync box is important as well as if you set it to Stream it plays the sound with your Motion Tween or when the red line comes to the waveform, if you set it to Event it plays when a button is pressed, if you set it to Start it plays right at the start of your Movie, if you set it to Stop it plays right at the end of your Movie. That's it! If not all of the sound file is being played you can drag the waveform from its end to make the sound last however long you want it, be advised that I found doing this very fiddly though when I was making my Flash e-card as part of my course.

Buttons

Buttons are not so easy. Start off by opening your Flash Document, (which includes something happening e.g a Motion Tween), and going to Insert -> New Symbol and selecting "button".

You should now see a blank stage, (don't panic, your work is still there!), and the words "Up", "Over", "Down", and "Hit". Proceed to add a Keyframe, (F6 or right-click -> Insert Keyframe), to each of these boxes.

Then draw a small button, whatever shape you want -> Copy -> Paste In Place, (This is important as it will prevent your button from jumping all over the place when you test your Movie). Then select "Over", change the colour of the button, select "Down" change its colour, and finally select "Hit" and change its colour one final time, make sure you have four different colours.

A new item should have appeared in your Library, specifically your button. Name it, create a layer for it, and, with this layer selected, drag your button onto the stage. Now this is the very important and tricky part, the code. The code in Flash is called ActionScript and any layer with code in it has a small "a" on the timeline. All code in Flash is inserted in the "Actions" window. I am going to supply the code for you, and I got it from my tutor. Here it is:

on (press) {

stopAllSounds();

gotoAndplay("Scene 1", 1);

}

Be sure to have your button selected on the Stage or Flash will not let you enter the code. If all has gone well when you test your Movie, (Control Menu -> Test Movie),whenever you press your button it should not only change colour but your Movie should begin again from the start.

The Color Mixer

Here's a small tip. If you want better shading for your objects, goto Window -> Design Panels -> Color Mixer. In the window that has just opened you should see a drop-down box with "NOne", "Solid", "Linear", "Radial", and "Bitmap". In my opinion Linear and Radial are the best if you don't want to use a Bitmap.

3-D Colours

If you click on the colour palette next to the Paint Bucket on the Drawing Tools, you should see small "globes" at the bottom. These are 3-D colours. Unfortunately there are only a limited number of colours available.

Making things disappear and reappear

This is a very simple tip that I wasn't taught, one which I discovered when I was using Flash 5, as far as I can remember about Flash 5 you do it differently in Flash MX.

Goto the Color Mixer, (see above), and you should now see a box called "Alpha" with a percentage value in it. If you select the object you want to disappear and change the Alpha value to 0% it should disappear, change it to 100% to make it reappear.

That's all the tips for now, if I can think of any more I might write another article! I hope you get those to work and by the way I spell colour that way because I'm British.

M Moyne has an OCN qualification in Macromedia Flash, equivalent to GCSE grade C. He used Microsoft Front Page 2000 to create M Moyne's Home Page and also My Orlando Guide. He also has a blog, which is on M Moyne's Home Page. Both his websites also contain RSS feeds and he may delve into the world of Flash sites some day.

Close    To Top
  • Prev Article-Web Design:
  • Next Article-Web Design:
  • Now: Tutorial for Web and Software Design > Web Design > Web Development > Web Design Content
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Geek Tutorial
     

    Blogging Tutorial

      RSS Tutorial
      Podcasting Tutorial
    Graphic Design Tutorial
      Coreldraw Tutorial
      Illustrator Tutorial
      3D Tutorials
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial/ Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial/ Articles
     

    XML Style

      AJAX Tutorial
      XML Mobile
    Flash Tutorial/ Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial/ Articles
      Linux Tutorial
      Symbian Tutorial
      MacOS Tutorial
    Personal Tech
      Hardware Tutorial
      Software Tutorial
      Online Auction