Flash >> Collision Detection Kit >> Video Example

Detecting collisions with video is easy.

This example demonstrates collision detections against an FLV. An FLV is placed on the stage and given a standard skin. Using the Collision Detection Kit, it's set up to detect collisions against the balls falling from above. Because the kit detects collisions based on pixel values, the balls fall straight through the video and onto Stephen Colbert. It even detects collisions with the player's controls!

This FLV was already set up with 0 alpha in the areas surrounding Stephen. But if you're working with video that doesn't have an alpha channel, you can use the kit's excludeColor() method to key out colors you don't want detected.

For more information on this package and how you can detect collisions against any display object, please reference the documentation.

This example shows how you can exclude alpha values from collision detections. See how the Collision Detection Kit can exclude colors from collision checking. See how you can detect collisions on the fly. Draw on the stage to see how easy it is to work with organic shapes. The Collision Detection Kit plays well with TextField objects, as this example demonstrates. The kit even works with video. Watch how easy it is in this example. This demonstration shows off an important part of the Collision Detection Kit - returning the angle of collision. The kit accounts for local transforms like scale and rotation, as demonstrated in this example.