Free ActionScript

Flash AS2 & AS3 Tutorials, Game Code, Effects, Source Files & Sample Downloads

Bitmap Trailer using Blitting technique

This is an AS3 mouse trailer example using the Blitting technique.

From Wiki on Blitting: “A classic use for blitting is to render transparent sprites onto a background.”

So instead of having 100′s of movieclips on the screen at the same time, you only have 1 bitmap object. This dramatically improves performance.

This also allows you apply filters to this bitmap image to achieve all kinds of fancy effects, such as this trailer using blur and alphaMultiplier (bitmap alpha control).

Preview v1.0.0

Download Fla Sample

Download Fla Sample

Pixel Perfect Collision Detection

Preview v1.0.1

Download Fla Sample

Download Fla Sample

This script was based on an example by Mike Chambers: Using BitmapData.hitTest for Collision Detection.

Update – v1.0.1
Added dynamic clip highlighting on hit

Pixel Perfect Collision Detection

This is a great “pixel perfect bitmap collision detection with rotation” script by Grant Skinner. This is definitely better than hitTest for rotated irregularly shaped objects and bitmap images. Works great with transparent pngs as well.

Preview

Download Fla Sample

Download Fla Sample

Original Bitmap Collision detection class by Grant Skinner
http://www.gskinner.com/blog/archives/2005/10/source_code_sha.html

Update
AS3 version of this script is available here:
http://www.freeactionscript.com/2011/08/as3-pixel-perfect-collision-detection/

Realistic Water & Wave Effect

Easy-to-use Flash AS2 dynamic water & wave effect.

Download Fla Sample

Download Fla Sample

To use, just copy the function and use it like so:
createWater(MyMovieClip);