Importing Spritesheets in Flash to Export them as MovieClips in SWC Libraries

There are several reasons we might have to export resources from flash:

  • to create libraries to reuse them in other flash projects
  • to use Flash Builder or Flash Develop for writing code and Flash to create graphical assets
  • to use swc libraries in haxe projects

Lets take the following sprite:


1. Create a new flash project save it and import the following image in library or simply drag and drop it in flash. In both the cases the image will appear in the library and an image:


2. Using the Rectangle Primitive Tool draw a rectangle of the dimensions of one frame in the sprite:


3. Now make sure the rectangle has no border and set the fill to Bitmap Fill and select the imported image to fill. In following picture the rectangle is a little bit larger than the actual frame to get an idea of what bitmap fill means:


4. Now right click on the rectangle and convert it to Symbol:


… and in the newly open dialog set the name of the MovieClip object. In order to export the plane resource, make sure the export to actionscript is checked.


5. Double click on the created MovieClip and add 3 more Keyframes. Now we have to change the rectangle in the first and third frames so it will result in an animated MovieClip.  To do so select the Gradient Transform Tool:



… and re-position the bitmap fill so the first frame from the spreadsheet is displayed. Repeat the operation for the third frame so in the end the MovieClip will look like this:


6 .Open File > Project Settings… and check the SWC option so the classes marked to be exported to AS at point 3 will be exported in the swc.



Leave a Reply

Your email address will not be published. Required fields are marked *