Copy link to clipboard
Copied
Hi all,
I have condensed this example to the following issue. As part of one of my jsfl scripts I am trying to break apart a text object in a scene and then add some keyframes, etc., but I can't seem to execute any of the Timeline methods after running the .breakApart(), including just selecting frames.
See the following example (run on a simple scene with text object selected) - if I leave out the last line it runs normally, but with the last line included, the application just terminates with no error message.
Same applies for inserting frames, or anything else I've tried to the timeline.
var tl = an.getDocumentDOM().getTimeline();
tl.insertFrames(100);
tl.setSelectedFrames(0, 1, true); //have to do all this timeline stuff BEFORE breakApart - why??
an.getDocumentDOM().breakApart();
tl.setSelectedFrames(0, 1, true);
Any ideas? Am running the latest version of Animate (24.0). Many thanks.
Copy link to clipboard
Copied
Hi.
It works for me.
What version of Animate are you using and how is your timeline structured?
Regards,
JC
Copy link to clipboard
Copied
Hi!
I tried to reproduce the crash on my end, but it doesn't happen – everything works smoothly. Apparently, the specific timeline structure matters.
Try to check the value of timeline.currentLayer immediately after breakApart(), as the command tl.setSelectedFrames(0, 1, true); operates on the current layer.
Copy link to clipboard
Copied
i see no problem either (with animate 24.0 on windows).
Copy link to clipboard
Copied
Thanks for the responses. I've tested this out on a fresh, empty project with just 1 layer, 1 frame and a single text object in the scene and still get the crash. I'm running on Windows 10 if that makes any difference.
The timeline.currentLayer seems to be showing a sensible number (e.g. 0 for the basic scene described, 5 for a different project where it's in the sixth layer).
On further investigation I've determined the script actually does run successfully if I copy it to the Commands folder and run it from the menu. Previously I had been running it directly from the code editor in Animate and this is still causing it to crash for me, so potentially this is some issue with the editor?
Copy link to clipboard
Copied
i'm using win 10.
i saved the jsfl to my hd, but not the commands folder and ran from there.