

- Flash actionscript 3.0 play embeded sound import software#
- Flash actionscript 3.0 play embeded sound import code#
This software converts all of your human-readable scripts into an optimized, machine-readable format. That is, a part of your Flash Platform application of choice (such as Flash Professional) contains software called the compiler.

When you publish a Flash file-using Flash Professional’s File✓Publish or Control✓Test Movie-all of the internal graphics and other assets used in your movie, as well as all of the ActionScript code, are compiled into a final file format called a SWF (pronounced “swiff” or “S-W-F”). If this isn’t news to you, bear with us for just a paragraph or two.
Flash actionscript 3.0 play embeded sound import code#
This brief introductory chapter will give you a quick look at where ActionScript 3.0 fits into your workflow.īefore we get started, it might help to understand how you get from ActionScript code to a finished file that you can put into a website. While you likely know that ActionScript is the main scripting language of the Flash Platform, and you’re no doubt eager to begin working with the new version, a brief overview of its development will give you some insight into its use-particularly as related to Flash Player and how it handles different versions of ActionScript. I hope you enjoyed reading the tut as much as I did writing it.Procedural Versus Object-Oriented Programming Keep trying different combinations to get the exact effect that you want. Remember that you can play with the parameters to get various effects and that you can also change the drops by drawing whatever you like. This will create a new Rain Object, then call the main function to start the effect. That's the class finished, to make use of it we go back to the Flash IDE, open the Actions Panel and write: import Classes.Rain It then resets the position when drops move outside the effect area. This moves the Drops based on the parameters of the main function. If (e.target.y>e.target.vArea+e.target.height)Į.target.x = Math.random() * (e.target.hArea - offset * 2) + offset * 2 In order to show various instances of the Drop MovieClip we have to create a new Drop Object inside a "For" statement: for (var i:int = 0 i e.target.vArea+e.target.height)Į.target.x = Math.random() * (e.target.hArea + (offset * 2)) Į.target.y+=Math.random()*e.target.fallSpeed Step 10 - Left or Right?īy default, the offset var is set to work with the left side, so we need to check where the rain will go and change the offset if the direction is right. You can change the number of drops, the speed at which the drops fall, the speed at which the drops will move horizontally, the size of the effect area and the direction of the rain (left or right). The main function, with some parameters making the effect easy to adapt to your needs. = new Vector.() //The Vector that will store each rain drop Step 9 - Main Function public function init(drops:int, fallSpeed:int, windSpeed:int, hArea:int, vArea:int, dir:String):void Private var dropsNumber:int //The number of rain drops its value is set in the parameters Without this, the corners of the effect area will be rain-free private var offset:int = 50 //This is the offset area in pixels that the effect will take.

Put simply, the Vector Class works like an Array, but is considerably faster. Here we'll use an exclusive Flash Player 10 Class "Vector".

In this case we use it to get access to the addChild() method. Step 7 - Extending the Class //We need to extend the class so we can use the addChild() method.Įxtending the MovieClip class will allow our class to inherit all of the methods, properties and functions that the MovieClip has. Remember that the word next to "package" is the name of the folder where our Class is located. Here we import the Classes that we'll use. Let's start off some code in a separate ActionScript file: package Classes
