Archive for extensions

$(UserConfig) variable in Flash CS4

Posted in Uncategorized with tags , , , , on November 17, 2009 by andkrup

I didn’t know, but it seems that you can reference your user-config folder with the $(UserConfig) variable, when setting class paths in Flash CS4.

You can create an mxi file that distributes a swc file and a jsfl command that adds “$(UserConfig)/Libraries” to the library path of the current working document.

The mxi extension source file:

<macromedia-extension name="Electric Library" version="0.1.0" type="flashcomponentswc" requires-restart = "false" >
<author name="Me" />
<product name="Flash" version="8" primary="true" required="true"/>
<![CDATA[My Library]]>
<![CDATA[My License agreement]]>
<file source = "MyLibrary.swc" destination = "$flash/Libraries" shared="true"/>
<file source = "bin/Add path to  My Library.jsfl" destination = "$flash/Commands" shared="true"/>

The “Add path to  My Library.jsfl” command file:

var myDoc = fl.getDocumentDOM();
myDoc.libraryPath = "$(UserConfig)/Libraries;" + myDoc.libraryPath;
fl.trace("class path: "+myDoc.libraryPath);

Use the Extension Manager to package the mxi file. This will create a mxp file that you can distribute.