The following example shows how you can loop over items in your Flash document’s Library panel, filter out the video objects and display a list of the item name and video types.
Full code after the jump.
// JSFL fl.outputPanel.clear(); var items = fl.getDocumentDOM().library.items; if (items.length > 0) { for each (var item in items) { switch (item.itemType) { case "video": fl.trace(item.name + " (" + item.videoType + ")"); break; } } } else { alert("The current Flash document's Library is empty."); }
Running this JSFL command produces output similar to the following (depending on what types of Video objects you have in your library, if any):
Embedded Video 1 (embedded video)
Embedded Video 2 (embedded video)
Video 1 (video)
Video 2 (video)
{ 0 comments… add one now }