View Full Version : Deleting a file type from the library
Hi,
Whats the easiest way to go about deleting a filetype from the library using JSFL?
For example deleting all the Bitmaps.
Cheers
animatorgeek
02-26-2008, 08:42 PM
I'd suggest you peruse the documentation. You can find them here (http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/js/html/wwhelp.htm) under "Extending Flash". It would probably be easy to do what you're saying by traversing the library items array:
fl.getDocumentDOM().library.items
Use a for loop to go through the array and, if the itemType property is "bitmap," delete it from the array. Probably you'd have to do this by working from your own copy of the array and then copy it back with something like this:
my_library_items = fl.getDocumentDOM().library.items;
// do stuff to my_library_items
fl.getDocumentDOM().library.items = my_library_items;
I'm not 100% positive this would work, but I think it should. That's how other things work in JSFL, such as the selection array.
Thanks, that was generally on the lines I was thinking so I'll crack on with it.
Cheers
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.