Rens
Rens

Reputation: 269

AS3 Hittest with Illustrator path

I export a path from Illustrator to an .swf file. I import this file using the Loader class in actionscript 3. Now I want to perform a collision test on this path in Flash. Is this possible? Now as3 performs this test on the whole bounds of the swf file. I only need the path. Is this possible?

Upvotes: 0

Views: 307

Answers (2)

Allan
Allan

Reputation: 92

It works good as long you not use any transparacy effects in Illustrator which you want to export, which not are compatible with swf.

There are two settings in ai exporting non compatible effects to swf file.

Appearance: which will make a bitmap under the swf, which make the hittestarea to a square. Editability: will remake the effects so good as the can to swf, which should possible still keep the polygon hittestarea, but it didnt work for me.

Upvotes: 2

Eugeny89
Eugeny89

Reputation: 3741

Yes that's possible. BitmapData.hitTest will help you (take a look at e.g. this)

Upvotes: 1

Related Questions