I mentioned in a previous post that we have developed standards for assigning linkage IDs here at gskinner.com, and a few people expressed interest in them so here’s a quick post to explain our two main standards, and a JSFL script to help keep your library nicely organized.
All of our code resides in class files, so all of our library assets are either bound to a class, or are contained within a clip that is bound to a class. Because we want to maintain obvious relationships between our clips and their associated classes, we mirror the full package path & class name for our clip linkages. Similarly, we also maintain our library structure to mirror our package paths.
So for a clip bound to the class “com.gskinner.controls.ComboBox”, the clip would:
- be named “ComboBox”
- sit in a directory path of “com/gskinner/controls/” in the library
- have a linkage ID of “com.gskinner.controls.ComboBox”
That takes care of classes bound to classes, but what about clips that require a linkage ID, but do not have a class bound? Because these clips will almost always be an asset of a bound clip, we can use the namespace of the bound parent clip, append a colon “:”, and add a unique identifier. We also dump these assets into a directory called “ParentClipName assets” in the library.
So a “RowRenderer” clip that is an asset of “com.gskinner.controls.ComboBox” would:
- be named “RowRenderer”
- sit in a directory path of “com/gskinner/controls/ComboBox assets” in the library
- have a linkage ID of “com.gskinner.controls.ComboBox:RowRenderer”
You’ll notice that the names of these clips are capitalized. I like to capitalize library item names, as they are the visual equivalent of classes (ie. the template that clip instances are created from), and class names should always be capitalized.
To make all of this a little easier, I have created a simple JSFL script that organizes your library according to linkage IDs. For example, if you created a clip with the linkage “com.gskinner.controls.ComboBox:RowRenderer” in your library, and ran the JSFL, it would create the directory path “com/gskinner/controls/ComboBox assets” in your library if needed, and move the clip there.
You can download it by clicking here. As always, you might want to run this on a copy of your FLA – there’s always the chance it’ll mess up your library. Let me know in the comments if you have any problems, or ideas for enhancing this script.