Joe
Joe

Reputation: 8042

How do you get Polygons from MovieClips in Flash?

I have an actionscript that reads an swf and goes through movieclips in it.

The movie clips should be simple shapes. I want to convert the data in these movieclips to a polygon. In other words, I want a series of coordinates that represent the shapes on the movieclip.

Upvotes: 4

Views: 248

Answers (1)

weltraumpirat
weltraumpirat

Reputation: 22604

There's no easy way to do this. Once a shape is drawn to the stage, the only graphical information you can access is the rendered pixel bitmap; all vector information is lost.

To transform shapes into polygons, you'll have to either analyze the ActionScript byte code stored in the SWF file (find and extract the bytes that contain vector drawing information and use it to re-create the shapes in code), or use the color info in the bitmaps to trace shapes (which is never going to be fully accurate, as you might guess).

Either way, this is not a simple task.

Upvotes: 4

Related Questions