0

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

1 Answers1

0

When you set var tle=dom.timelines[0]; you are saying, in effect, "Let me use tle in place of dom.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.tle

Which is correct. libraryItem is an object of type [SymbolItem], and SymbolItems don't have children named tle. Though they do have a child named timeline, which is likely what you want.

Also, the last trace statement won't mean what you expect because you're in the ctl timeline and not the tl timeline. For testing you may want to start with fl.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

Dre G
  • 56
  • 6