» Are you looking for FLV Player?

Enable / disable _exclude.xml files

29 October 2004 | filed under flash | no comments

I often create applications that consist of multiple loaded movies. In order to reduce the overall filesize of the .swfs in my project, I use so-called exclude files. To make life a little easier, I wrote two JSFL Commands that allow me to quickly enable and disable all exclude files for a project.

JSFL icon First some background info on exclude files if you’re new to the subject. If you know what exclude files are all about, scroll down to download the JSFL Commands.

An exclude file tells the compiler not to compile specific classes into a swf. That’s great, because often, you already have several base classes loaded in a main or container movie, so you don’t need to have them compiled into movies which are loaded by the container movie.

For example, the container uses the mx.transitions.Tween class and also the mx.transitions.easing.Regular class. That functionality will now not only be available for the movie the classes are compiled in, but for every subsequently loaded movie. That means we don’t need to include those classes in any loaded movie.

An exclude file is always named [name_of_.fla_file]_exclude.xml. So, to exclude classes from being compiled into a file named dealers.fla, create an exclude file named dealers_exclude.xml in the same directory.

In this case, the exclude file would look like this:

[xml]


[/xml]

Easy. One minor drawback, you can’t use wildcards to exclude complete packages at once, you need to specify each and every class explicitly.

Unfortunately, when developing and testing your movies, you obviously need all classes to be present in the .swf, or you won’t be able to properly run your swf. That means moving or renaming all exclude files when testing standalone and placing them back when publishing your project. This can become pretty annoying.

As I always create a directory named /excludes/ to place my exclude files in when they’re not needed, I thought it would save me a lot of time to write a JSFL command that does that for me. In the downloadable zip file below you’ll find a Disable Excludes command that moves all exclude files found in the folder of the currently open .fla to a subdir named /excludes/ (which will be created if not present). There’s also a complementary command called Enable Excludes that moves them back.

Download Enable / Disable Excludes Commands.

Also note the pretty Output Panel feedback when you run the commands. :-)

To install, download the .zip file and extract both files to your user data folder, which is C:\Documents and Settings\[username]\Local Settings\Application Data\Macromedia\Flash MX 2004\en\Configuration\Commands under Windows.

 

Leave a Reply