Multiple timelines detected in JSFL
I have a JSFL script that I wrote to convert Graphic types back to MovieClips. I want to run it on main timeline. What I have found is a call to
document.getTimeline()
or
document.currentTimeline
is dependent upon the current timeline the current document is in. So, for example, if you are in the timeline of a symbol, it will be using that timeline.
As I want this applied to the whole file, I need to access the main timeline.
var dom = fl.getDocumentDOM()
var timelines = dom.timelines
for (t in timelines) {
fl.trace("TIMELINE " + timelines
.name + " " + timelines .libraryItem) }
I used this code as a test. The results yielded:
TIMELINE LevelUpPopup-0 null
TIMELINE LevelUpPopup-0 null
It appears they are identical (I checked the layers but have omitted for brevity here).
I'm curious if anyone knows why there are two identical timelines showing up. Note that they both are showing the scene name. And the null for the libraryItem is supposed to indicate it is the scene as well.