Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function processInstance(instance,path) {
- if(instance.libraryItem.symbolType != instance.symbolType) {
- //fl.outputPanel.trace(path+" should be "+instance.libraryItem.symbolType+" but is "+instance.symbolType);
- instance.symbolType=instance.libraryItem.symbolType
- }
- }
- function processTimeline(t,path) {
- //all the layers...
- for(var i=0;i<t.layers.length;++i) {
- var layer=t.layers[i];
- var subpath=path+"/"+layer.name;
- //frames...
- for(var fi=0;fi<layer.frames.length;++fi) {
- var frame=layer.frames[fi];
- var subpath=path+"/"+(frame.startFrame+1);
- //and elements.
- for(var ei=0;ei<frame.elements.length;++ei) {
- var element=frame.elements[ei];
- if(element.elementType=="instance" && element.instanceType=="symbol") {
- var subsubpath=subpath+"/";
- if(element.name) {
- subsubpath+=element.name;
- } else {
- subsubpath+=ei
- }
- processInstance(element,subsubpath);
- }
- }
- }
- }
- }
- function processDocument(doc) {
- //scan all the scenes
- for(var i=0;i<doc.timelines.length;++i) {
- var scene=doc.timelines[i];
- processTimeline(scene,scene.name);
- }
- //scan all the library symbols
- for(var i=0;i<doc.library.items.length;++i) {
- var symbol=doc.library.items[i];
- if(symbol.itemType=="movie clip" || symbol.itemType=="button" || symbol.itemType=="graphic") {
- processTimeline(symbol.timeline,symbol.name);
- }
- }
- }
- fl.outputPanel.clear();
- processDocument(fl.getDocumentDOM());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement