Capítulo 170 de 411
Labels only exist within the timeline they were added to, so a parent timeline can't seek() directly to a label defined inside a nested child timeline. This helper walks the child hierarchy to translate a nested label into the parent's own time coordinate.
startTime()/timeScale() to convert the nested time into the outer timeline's timescale.tl.seek(getNestedLabelTime(tl, "someNestedLabel")).function getNestedLabelTime(timeline, label) {
let children = timeline.getChildren(true, false, true), i = children.length, tl, time;
while (i--) {
if (label in children[i].labels) {
tl = children[i];
time = tl.labels[label];
break;
}
}
if (tl) {
while (tl !== timeline) {
time = tl.startTime() + time / tl.timeScale();
tl = tl.parent;
}
}
return time;
}
seek() on work with no helper.