by Adobe

Adobe logo


19 July 2010



User level



Required products

Sample files

ActionScript can perform a hit test operation to determine whether two objects have collided on the Stage. You can either test for an object hitting another object or an object hitting a point on the Stage. This functionality is used often in games to evaluate collision of players and obstacles.

The sample demonstrates a maze game where the player icon navigates through the maze pattern. Press the up, down, left, and right arrow keys on the keyboard to navigate to the finish line.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

More Like This


Time sample: Stopwatch timer

Media sample: Dynamic sound generation

Media sample: TLF text formatting using CSS

Media sample: Sound channels

Media sample: Image loading

Media sample: Dynamic text

Interactivity sample: Background scrolling

Media sample: Sound loading

Interactivity sample: Joystick-controlled movement

Drawing sample: 3D rotation