Background tutorial Flash - Skin Investigation

Background tutorial Flash

Create a Whimsical Animated Flash Background


Twice a month, we revisit some of our readers’ favorite posts from throughout the history of Activetuts+. This tutorial was first published in May, 2009.

Using ActionScript 3.0, we'll create a cool Animated Background that we can use in Menu Screens or as a Music Visualizer.

Final Result Preview

Let's take a look at what we'll be working towards:

Step 1: Brief Overview

We'll create a Class that will take care of the whole effect. When you call the class, you'll be able to change the number of lights, color, alpha, size, direction, speed and the quality of the Blur filter. In this way it's possible to achieve many different results when using it. Also, you can use any background you want.

Step 2: The .fla Document

Create a new ActionScript 3.0 document (File > New...). Set the Stage size to your desired dimensions, I've used 600 x 300 px.

Step 3: Your Background

Add or draw an image to use as the background, I've used a simple blue gradient (#02C7FB, #1F63B4).

Step 4: Layers

Rename the first layer to "Background" then create another one and name it "Code". You can lock the "Code" layer to avoid placement of unwanted drawings in there.

Step 5: ActionScript

Save your work and let's get into the code!

I'm assuming you already have a basic understanding of ActionScript 3.0, if you have any keyword specific doubts please refer to the Flash Help (F1).

Create a new ActionScript file (File > New...).

Step 6: Importing Required Classes

package Classes { /* Import required classes */ import flash.display.MovieClip; import flash.filters.BitmapFilter; import flash.filters.BlurFilter; import flash.events.Event;

Here we import the Classes that we'll use, remember that the word next to "package" is the name of the folder where our Class is located.

Step 7: Extending the Class

//We need to extend the class so we can use the addChild method. public class Lights extends MovieClip {

Extending the MovieClip class will allow our class to inherit all of the methods, properties and functions that the MovieClip has, in this case we use it to get access to the addChild method.

Step 8: The Variables

Although they have pretty much self explanatory names I'll add short comments on each var to make sure it's clear. They get their values from the parameters of the Main function.

private var lightsNumber:int; //The number of Lights on Stage private var xSpeed:int; //The horizontal speed the Lights have private var ySpeed:int; //Vertical Speed private var lightsDir:String; //Direction the Lights are going, this can be Up, Down, Left or Right private var areaW:int; //The width of the area where the effect will take place private var areaH:int; //Height private var lights:Array = new Array; //This array will store all the Lights MovieClips so we can use them outside the For where we are going to create them.

Step 9: Main Function

/* Main function */ public function init(areaWidth:int, areaHeight:int, numberOfLights:int, lightSize:int, lightColor:uint, minimumScale:Number, hSpeed:int, vSpeed:int, dir:String, quality:int):void { areaW = areaWidth; areaH = areaHeight; lightsNumber = numberOfLights; lightsDir = dir;



Resources

More about Background tutorial Flash

Need help w/making an image bg transparent

by helllp

Hello,
I know this is probably the simplest thing to do (and I'm sure I'll get some flack from someone) but I cannot seem to get it.
I just need to know how you take a pic or scanned item and make the background transparent. I am trying to design and code my own website (1st time), and this is something that I will really need to know.
Can someone please give me a simple step by step tutorial on how to do this? I have Photoshop, Photoshop Elements, and Image Ready to work with.
I've tried using Adobe's help page, but it is overwhelming with instructions and the ones I thought would help me have not

Real Swiss Wristwatches Tax and Duty Free Price PATEK PHILIPPE Watches For Sale at Discount Prices Styles for men and ladies including: Aquanaut, Calatrava Annual Calendar, Compicated, Diamonds Skeleton, World Time, Moon, 18K rose gold Golden Ellipse, Nautilus Stainless Steel, and 24 Twenty-4.

Charles River Media Macromedia Flash Professional 8 Game Development (Charles River Media Game Development)
Book (Charles River Media)

CorelDRAW X7 review: Customizable features make this robust design program ..  — PCWorld
.. purchase, as well as a $25 monthly subscription. People miffed by Adobe's wholesale move to subscriptions will find a great alternative here. ..

Galaxy 61 Delivers Show Open for VH1's 'The Fabulous Life  — Animation World Network
VHI recently called upon Galaxy 61 to create a show intro for the new 2014 season of The Fabulous Life, the hit series that reveals the extravagant places, possessions and pastimes of pop-culture's most famous celebrities. The Brooklyn-based ..

CrystalGraphics, Inc. PowerPlugs: Slides That Win! for PowerPoint
Software (CrystalGraphics, Inc.)
  • Easy-to-use computer-based training product for presenters!
  • Includes over 300 visuals that illustrate the right way and wrong way to design your slides!
  • Hundreds of PowerPoint tips, tricks and notes in printable format!
  • Helpful quizzes to test your knowledge!
  • Works with PowerPoint 97 through 2007 and Windows 95 - XP!
Panasonic Panasonic LUMIX DMC-FZ70 16.1 MP Digital Camera with 60x Optical Image Stabilized Zoom and 3-Inch LCD (Black)
Photography (Panasonic)
  • Bring the action in super close with category class leading 60X optical zoom (20mm-1200mm)
  • Experience Full 1080/60i HD Panasonic Video recording with auto focus
  • Zoom focused Dolby quality sound recording locks out ambient noise for enhanced audio quality
Related Posts