InteractivePNG – AS3 Class to handle hit areas for transparent PNG's

Moses Gunesch, creator of Fuse Kit and ZigoEngine , has developed an AS3 Class which handles mouse interactions when dealing with transparent PNG’s.

Here is the theory:
If you have a PNG (one that contains transparent areas) embedded inside of a MovieClip button, the rectangle of the image acts as the hitArea of the MovieClip. In order for the hitArea to only be defined by visible areas of the image, you would normally have to create a custom mask in order to hide the transparent areas of the PNG. This AS3 Class allows you to specify an alpha tolerance (0=transparent, 255=completely opaque), that will allow you to selective exclude the transparent areas from your hitArea based on the value that you give it. This is a very simple concept, but an intricate implementation.

The project is open-sourced under the MIT  Open Source License. Go and check it out:

Date
February 2, 2009
Time
5:27 pm
Category
Uncategorized
Tags
Tags: , , ,


PNGPong v1.0.0: Displaying transparent PNGs in IE

I’d like to announce the first public release of PNGPong, a cross-browser solution for displaying transparent PNGs on the web for IE, Firefox, and Safari.

Download Links

For more details check out the PNGPong project page.

It’s been tested by several developers and QA people and is in use for a high traffic site. Please note that the Javascript API and functionality was created out of the needs of a specific project. I’d be happy to hear your thoughts on improvements.

Thanks for checking this out.

Date
April 17, 2007
Time
1:41 am
Category
Uncategorized
Tags
Tags: , , , , , ,