• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

JSFL script crashes when running timeline methods after breakApart

Community Beginner ,
Jan 07, 2024 Jan 07, 2024

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.

Views

199

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 08, 2024 Jan 08, 2024

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 08, 2024 Jan 08, 2024

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.

 

 

- Vlad: UX and graphic design, Flash user since 1998
Member of Flanimate Power Tools team - extensions for character animation

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 08, 2024 Jan 08, 2024

Copy link to clipboard

Copied

i see no problem either (with animate 24.0 on windows).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 09, 2024 Jan 09, 2024

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 09, 2024 Jan 09, 2024

Copy link to clipboard

Copied

LATEST

i'm using win 10.

i saved the jsfl to my hd, but not the commands folder and ran from there.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines