Export SWC without the SWF
Posted 26 July 2010 by Matan UbersteinUpdate – 24 Augusts 2010:
I’ve packaged this into a MXP file so now you can just install it! In the source bundle you’ll find the JSFL, MXI and the MXP. Execute the MXP file to install the script. The other two files are just the source files used for packaging the MXP.
- ExportSWC – Includes all source and MXP file.
Original Post:
I wrote this jsfl script in response to this feature request from the Flash community.
Copy the source below and save it as “Export SWC.jsfl” in your Commands directory. The Commands directory can be found at C:\Users\{USER_NAME}\AppData\Local\Adobe\Flash CS5\en_US\Configuration\Commands on windows and /Users/{USER_NAME}/Library/Application/Support/Adobe/Flash/CS5/en_US/Configuration/Commands on Mac.
var dom = fl.getDocumentDOM();
var domFolder = getDomFolder();
var publishURI = getPublishURI();
dom.publish();
if(FLfile.exists(publishURI))
FLfile.remove(publishURI);
function getPublishURI()
{
var profileXML = new XML(dom.exportPublishProfileString()).children();
for(var i = 0; i < profileXML.length(); i++)
{
var node = profileXML;
switch(String(node.name())){
case "PublishFormatProperties" :
return domFolder + "/" + String(node.flashFileName);
break;
}
}
}
function getDomFolder()
{
var splitURI = dom.pathURI.split("/");
splitURI.pop();
return splitURI.join("/");
}
You might need to restart Flash to make it appear in your “Commands” menu.
CS5 changed changed the shortcut for publishing from “shift+F12″ to “shift+alt+F12″, so let’s set a shortcut for this script file to “shift+F12″.
Go to Edit -> Keyboard Shortcuts… and assign the “Export SWC” shortcut to “shift+F12″.
Please note this script does not automatically flag “Export SWC” to true, so you still need setup your publish profile as per usual.
Now you can simply press “shift+F12″ to export your SWC only!










Pingback: Tweets that mention Export SWC without the SWF | Matan Uberstein | AS3 Blog -- Topsy.com
Pingback: Using Assets in FDT (Flash > SWC > Linked Library) | Beautify Code Blog
Pingback: Tweets that mention Export SWC without the SWF | Matan Uberstein | AS3 Blog -- Topsy.com