Finishing up a project which consists of a series of Flash presentation SWF’s. The controller that plays them uses an XML file to determine what SWF’s to play as well as what their frame labels are. Since I have to document this manually, and some of the SWF’s have timelines between 7 to 10 thousand frames long, scrolling to find them is tough. Thus, I made this script to list them for me. Assumes you have a layer named “labels”.
show frame labels – JSFL
function init() { var doc = fl.getDocumentDOM(); var tim = doc.getTimeline(); var l_array = tim.layers; var i = l_array.length; while(i--){ var lay = l_array[i]; if(lay.name.toLowerCase() == "labels"){ var f_array = lay.frames; var s = ""; var last = ""; for(var f=0; fif(f_array[f].labelType == "name"){ if(f_array[f].name != last){ s += "frame: " + f_array[f].name + ", number: " + (f + 1) + "\n"; last = f_array[f].name; } } } fl.trace("*** Frame Labels ***"); fl.trace(s); return; } } } init();
NIce!
Almost as easy as Directors ” put the markerList” ;)
At least with Director at runtime, you can get the current frame’s label… using it’s timeline, or a Flash sprite’s!
Not sure if you’ve seen the Frame Labels extension from the guys at Teknision
http://www.teknision.com/extensions/framelabels.mxp
Goes through your timeline and lists all of your frame labels…then allows you to insert them in to the actions panel as an Array.
Could be handy?
Funny you should mention it; I tried that very extension since I have it installed, and even after 2 script errors, it wouldn’t show. That’s the whole reason I wrote the script cause his window didn’t work with such long SWF’s.
it didn’t work…I put the code at the first frame and a stop(); it gives me bunch of error code..
That is JSFL, not ActionScript. Therefore, it must be in an external file (usually), with a jsfl extension. You can then run it in Flash MX 2004 via Commands > Run Command… find the file, select it, and hit ok.