As many of you know, the project panel in Flash CS4 is a rebuilt version of the gProject panel that Adobe acquired from us. For a variety of reasons, the project panel shipped with a few rough edges that I was never entirely happy with. So when we had some free time here at the office, we looked to rectify some of those issues. Here are the major changes:
- Skinned to match the CS4 interface (based on Library panel)
- Tightened up the actions menu
- Added a utilities submenu, which you can add your own utilities to
- Specify whether to open files in Flash or via the OS on a per file type basis in Panel Preferences > Settings
- Option to import assets to stage or library in Panel Preferences > Settings
- Shrunk some dialogs, and made them scroll to reduce minimum panel size
- Added more file type icons
- Added an API for scripting the panel with JSFL (details below)
- Minor UI tweaks
Note that this update is unrelated to Adobe (though it is distributed with their blessing), and is provided as a friendly service of gskinner.com. We are not getting paid to make these updates, and are not officially supporting them (though please feel free to provide feedback in the comments, and we’ll see what we can do).
There are a few things I would still like to address, but its unlikely to happen in the near future:
- Making it so directories don’t collapse when you compile or refresh (requires time)
- Enhance project portability (requires time)
- Making all of the panel icons consistent with other panels (requires time or assets from Adobe)
- Multi-compile without opening FLAs (requires JSAPI support from Adobe)
- Move dialogs out of panel (requires bug fixes from Adobe)
- Support scroll wheel on Mac (requires support from Adobe)
- Remove default items from context menu (requires support from Adobe?)
You can download the updated project panel by clicking here.
Project Panel JSAPI
There are a couple of limitations with the swfPanel API in JSFL that have forced us to use some unusual approaches:
- Due to a bug with the JSFL swfPanel api only one parameter can be sent, and that parameter must be of type string. Therefore multiple parameters are passed as a semi colon separated string.
createProject(uri, name, version);
- The swfPanel.call method can only return string values, so boolean or numeric values will be returned as a string. Actual string values are returned as a string, but within quotation marks. Arrays are returned as a semi-colon delimitated string (within quotation marks). For example, the actual value of a returned array will be a string: “value1;value2;value3” (including the quotation marks).
We have documented the the API below as though these limitations did not exist. Note that where an API supports a “path”, it will accept both URIs and relative paths.
createProject(uri:String, name:String, asVersion:Number) // asVersion can be 2 or 3, uri can point to an FLA or a directory createQuickProject() openProject(uri:String) // Recent project list: getRecentProjectList():Array // Project settings (affect current project): getName():String setName(value:String) getURI():String setURI(value:String) getASVersion():Number setASVersion(value:Number) // value can be 2 or 3 getClassTemplate():String setClassTemplate(uri:String) getSymbolClassTemplate():String setSymbolClassTemplate(uri:String) runCompileList():Boolean getCompileList():Array addToCompileList(uri:String):Boolean removeFromCompileList(uri:String):Boolean getLocationNames():Array getLocationURIs():Array addLocation(uri:String, name:String) removeLocation(uri:String):Boolean getFlexSDKPath():String setFlexSDKPath(value:String) // for source, library, and external lib: getLibraryPaths():Array addLibraryPath(uir:String) removeLibraryPath(uri:String); getSourcePaths():Array addSourcePath(uri:String) removeSourcePath(uri:String) getExternalLibraryPaths():Array addExternalLibraryPath(uri:String) removeExternalLibraryPath(uri:String)
You can also download a sample JSFL file that uses the API here.