$(UserConfig) variable in Flash CS4

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" />
<products>
<product name="Flash" version="8" primary="true" required="true"/>
</products>
<description>
<![CDATA[My Library]]>
</description>
<ui-access>
<![CDATA[n/a]]>
</ui-access>
<license-agreement>
<![CDATA[My License agreement]]>
</license-agreement>
<files>
<file source = "MyLibrary.swc" destination = "$flash/Libraries" shared="true"/>
<file source = "bin/Add path to  My Library.jsfl" destination = "$flash/Commands" shared="true"/>
</files>
</macromedia-extension>

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.

Advertisements

2 Responses to “$(UserConfig) variable in Flash CS4”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: