View comments | RSS feed

Exporting SWC files

Flash provides the ability to export SWC files by exporting a movie clip as a SWC file. When exporting a SWC file, Flash reports compile-time errors as if you were testing a Flash application.

There are two reasons to export a SWC file:

Exporting a SWC for a completed component

You can export components as SWC files that contain all the ActionScript, SWF files, and other optional files needed to use the component.

To export a SWC file for a completed component:

  1. Select the component movie clip in the Flash library.
  2. Right-click (Windows) or control-click (Mac) to open the Library context menu.
  3. Select Export SWC File from the Library context menu.
  4. Save the SWC file.

Testing a SWC during development

At different stages of development, it's a good idea to export the component as a SWC and test it in an application. If you export the SWC to the Components folder in your user-level Configuration folder, you can reload the Components panel without quitting and restarting Flash.

To test a SWC during development:

  1. Select the component movie clip in the Flash library.
  2. Right-click (Windows) or control-click (Mac) to open the Library context menu.
  3. Select Export SWC File from the Library context menu.
  4. Browse to the Components folder in your user-level configuration folder.

    Configuration/Components

    NOTE

     

    For information about the location of the folder, see "Configuration folders installed with Flash" in Using Flash.

  5. Save the SWC file.
  6. Select Reload from the Components panel's options menu.

    The component appears in the Component panel.

  7. Drag the component from the Component panel into a document.

Flash CS3


Comments


yozzozo said on Jun 22, 2007 at 2:27 PM :
There appears to be a bug with Flash CS3 and exporting SWC files.

From a fresh launch of the app:
1) Create a new .FLA file, for ActionScript 2.0.
2) In the library, make a new MovieClip symbol.
3) Make sure the symbol is opened (or open it).
4) Drag a DataGrid from the Components panel to the Stage.
5) Right click on the new symbol (not the DataGrid) in the library, and choose Export SWC File.... then type anything for the filename then click Save.
6) Watch it hang forever! (it attempts to compile the clip first)

This crash/hang can be worked around by the following (assuming the previous example is used):
4a) Right click on the DataGrid that was just put on the Stage. Select Convert to Symbol... then make sure the type is set to MovieClip, then click OK.

Hopefully a fix for this will be in the first Flash CS3 service pack :)
jpwrunyan said on Jul 24, 2007 at 5:10 PM :
Don't know if the above issue has been fixed, but in the version of CS3 I have it still exists.
Anyway, I just want to add that in case you have multiple components (the above is just with the one DataGrid) you do not need to put them all into individual dummy movie clips. It appears you can group them together all in one clip and that will allow you to compile the swc. Hope maybe that saves someone a little time.
tderich said on Sep 25, 2007 at 2:54 PM :
A bug is in the queue for this issue. The reference number is 205569.
seany_on_craic said on Feb 25, 2008 at 5:02 PM :
I suppose it is normal for a compiled SWC to completely ignore any root timeline actionscript? I suppose the class generated takes over...too bad; I usually like to include simple stop(); to make things easier...

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00002523.html