PDA

View Full Version : Linking multiple movieClips


jdecarie
02-03-2007, 10:04 PM
Hello

I'm wondering if anyone knows a way to to link multiple movieClips at once.
I jave 250 symbol in my library and just want to link them with their symbol name.

Thanks,

krayzeebean
02-06-2007, 10:31 PM
I haven't tested this but it should at least get you on the right track:


var lib = fl.getDocumentDOM().library;
var libitems = lib.items;

for (i = 0; i < libitems.length; i++){
if (lib.items[i].itemType == "movie clip"){
lib.items[i].linkageIdentifier = lib.items[i].name;;
}
}

If your movie clips are in folders then you'll need to remove the path from the items name first. You can use substring and lastIndexOf methods for that; they're not covered in the Flash help file but there's tons of javascript sites on the web that have examples of how to use them.