0
votes

I have a simple shape I have drawn in Flash, and I want to know if it's possible to convert that shape into actionscript 2 code so that it is drawn by code instead of it being a symbol in the fla file.

The reason being is that I have a global.as shared actionscript file that is used in 4 different applications and I don't want to add this shape to every application, for maintenance purposes. Is there an easy way to convert or do I have to code it from scratch?

Thanks for your help.

2

2 Answers

2
votes

I'm not 100% sure this will help you, but i've heard of others using this method to accomplish a similar task...

If you're using Flash CS5.5 you can save your FLA as an .XFL file which then exports all the objects in your flash project library (your polygon) into separate AS or XML files that are outside of the actual .FLA. After doing this you could simply find the code and copy/paste or import it into your existing project. When you select 'Save As..." you pick where the new files will all be placed, they're named automatically or by movieclip name so you'll have to parse through them.

Let me know if you try this, and if it it works for you.. may be something I try later in the future :) good luck!

0
votes

There's a jsfl script here which will spit out the polygons and vertices of your shape to the output panel. Apparently it's heavily based on this Adobe example. I'd imagine you can either use one of these directly, or amend them to suit your needs, such that you have the information needed to redraw your shape in ActionScript using the drawing API.