I have several symbols on the stage, rectangles and a circle. symbols on stage I want to get into the circle and animate the symbols in it using jsfl. I saw this link Accessing child/nested movie clips with JSFL AS3 CS5.5 and based on that I wrote this code.
fl.outputPanel.clear();
var dom = fl.getDocumentDOM();
var tl = dom.getTimeline();
var curFrame = tl.currentFrame;
var curLayer = tl.findLayerIndex('Layer 2');
tl.setSelectedFrames(curFrame,curFrame);
dom.selection = [tl.layers[curLayer].frames[curFrame]];
//dom.enterEditMode('inPlace');
var tle = dom.timelines[0];
var elm = tle.layers[curLayer].frames[curFrame].elements[0];
var lt = elm.libraryItem;
var ctl = lt.tle;//????
fl.trace(ctl.layers[curLayer].frames[curFrame].elements);
now i guess i must have bundled something because i get this 'typeerror: ctl has no properties'. the error message pls help me with suggestions on how to achieve what i want. thanks in advance
When you set
var tle=dom.timelines[0];you are saying, in effect, "Let me usetlein place ofdom.timelines[0]from now on."So the error message is telling you that this thing doesn't exist:
dom.timelines[0].layers[curLayer].frames[curFrame].elements[0].libraryItem.tleWhich is correct.
libraryItemis an object of type [SymbolItem], and SymbolItems don't have children namedtle. Though they do have a child namedtimeline, which is likely what you want.Also, the last
tracestatement won't mean what you expect because you're in thectltimeline and not thetltimeline. For testing you may want to start withfl.trace(ctl.layers[0].frames[0].elements);The reference document is here: https://help.adobe.com/archive/en_US/flash/cs5/flash_cs5_extending.pdf