Actionscript3 Reference

Actionscript3 Send post data along with file upload in AS3

You can pass additional variables to an upload script using either the POST or GET request method. To send additional POST variables to your upload script, you can use the following code:

Actionscript3 Quick AS3 dropshadow filter example

This will add a dropshadow filter to a sprite (here symbolized as the variable oSprite):

For information on the parameters visit the actionscript pages on the dropshadow http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/filters/DropShadowFilter.html

Actionscript3 Move DisplayObject to front or top of displaylist

To move a DisplayObject to the top of the displaylist use the following (where parent is the container of the object being moved to the front). This makes it appear like it's in front of any other DisplayObjects.

Actionscript3 Load a sound and play it

You should preload sounds in as3 before playing them to prevent awkward pauses while the sound effect loads for the first time. To load and play an external sound the following code suffices (in which the first line (pre)loads the file and the second line plays it). Place the first bit in your constructor function and the second in the event handler playing the sound

Actionscript3 ADDED event listener

The stage object can only be accessed after an object has been added to the display list.


Actionscript3 TransitionManager example

A quick example of the transitionmanager in a method:

Actionscript3 Handling Mouse Events in AS3

Possible mouse events are :

Actionscript3 Click handler eventlistener in as3

to capture mouse click event and excute a function :

Actionscript3 handcursor buttonmode

Use this code to show the handcursor when hovering over a displayobject in as3. The cursor turns into a pointing finger similar to the css cursor:pointer directive.

Actionscript3 Fade out function AS3

This function fades out the current stage by drawing a filled rectangle on top of it and tweening the alpha. Can be used for modal by adding a child on top of it.

Actionscript3 Loader class example

This is an example showing an application of the loader class with all it's handlers - this example is from the Flash help files. Usually you don't need all of them but it's handy to have an overview.

Actionscript3 remove all children from displayobject in actionscript 3

To remove all children from a displayObect in as3 you can use the following loop:

Actionscript3 Scale loader content from/to center in AS3

When tweening, resizing / rescaling an image loaded with the as3 loader class in certain cases it looks neater if it rescales to the center of its parent.

Actionscript3 load xml file as3

xml as3This example shows what to include and some sample code for loading xml data in an AS3 class.

Actionscript3 tween class example

A Simple example of tween class usage with callback in as3:

Actionscript3 read Flash vars in AS3

Small example illustrating how to get to passed flash vars in AS3

Actionscript3 Call javascript function from AS3 and viceversa

Quick example on how to call a js function via URLRequest:

[x]