There is no easy way to do this. After the figure is displayed on the scene, the only available graphic information that you can get is the displayed bitmap of the pixel; all vector information is lost.
To convert shapes to polygons, you will either have to analyze the ActionScript byte code stored in the SWF file (find and extract bytes containing the vector drawing information and use it to recreate the shapes in the code), or use the color information in the bitmap images to track shapes (which, as you can guess, will never be completely accurate).
In any case, this is not an easy task.
source share