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

How to control the number of frames of a specified layer within a symbol through jsfl

Contributor ,
Sep 25, 2022 Sep 25, 2022

Copy link to clipboard

Copied

Implementation using jsfl,Symbol one shows the fifth frame of layer three

2345.png

TOPICS
ActionScript , Code , Exchange extensions

Views

243

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 ,
Sep 26, 2022 Sep 26, 2022

Copy link to clipboard

Copied

layer.frames is read-only so you can't add/remove frames to a layer. you can insert and remove frames from a timeline.

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
Contributor ,
Sep 26, 2022 Sep 26, 2022

Copy link to clipboard

Copied

The third layer is the symbol,Can you control it to display the fifth frame of a single frame?

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 ,
Sep 27, 2022 Sep 27, 2022

Copy link to clipboard

Copied

i'm not sure what you've done, but you can convert a layer to a symbol (specifically a movieclip) and then you can manipulate that (and every other) moveiclip symbol's timeline by using timeline.cutFrames() and timeline.insertFrames() 

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 ,
Sep 27, 2022 Sep 27, 2022

Copy link to clipboard

Copied

Hi,

If I understand your question correctly, I think that the property you looking for is called firstFrame. If you want to display frame 5 of the internal timeline of a symbol, its instance on the stage should be graphic.

Then, you can select the instance and execute the following code:

 

fl.getDocumentDOM().selection[0].firstFrame = 4;

 

 

This will set the displayed frame of the selected instance at the current keyframe to 5.

 

 

- 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
Engaged ,
Sep 27, 2022 Sep 27, 2022

Copy link to clipboard

Copied

As an additional advice:
You can open your History Panel, right click on it and choose:
View > Javascript in Panel.
In this way, you'll see all the corresponding JSFL statements when you make changes via the UI.

Also, here is the complete (almost) JSFL documentation.

 

 

- 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
Contributor ,
Sep 27, 2022 Sep 27, 2022

Copy link to clipboard

Copied

I would like to be able to specify the number of frames in the layer inside the scene control symbol

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
Contributor ,
Sep 27, 2022 Sep 27, 2022

Copy link to clipboard

Copied

01.png02.png03.png

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
Contributor ,
Sep 27, 2022 Sep 27, 2022

Copy link to clipboard

Copied

so that there is no need to go inside the symbol for control

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
Contributor ,
Sep 30, 2022 Sep 30, 2022

Copy link to clipboard

Copied

@Vladin M. Mitov Can you take a look at my project file?

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
Contributor ,
Sep 30, 2022 Sep 30, 2022

Copy link to clipboard

Copied

What if all layers are inside a symbol

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
Contributor ,
Sep 30, 2022 Sep 30, 2022

Copy link to clipboard

Copied

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
Contributor ,
Oct 01, 2022 Oct 01, 2022

Copy link to clipboard

Copied

截屏2022-10-01 下午3.16.45.png

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 ,
Oct 01, 2022 Oct 01, 2022

Copy link to clipboard

Copied

LATEST

see your post, https://community.adobe.com/t5/animate-discussions/how-to-choose-a-specific-layer/m-p/13238484#M3574...

 

or

 

var layerIndex = fl.getDocumentDOM().getTimeline().findLayerIndex("your_layer_name");


fl.getDocumentDOM().getTimeline().setSelectedLayers(layerIndex[0], true); 

/* if you have same named layers, index 0 might not be what you want. */

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
Contributor ,
Sep 30, 2022 Sep 30, 2022

Copy link to clipboard

Copied

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
Contributor ,
Sep 30, 2022 Sep 30, 2022

Copy link to clipboard

Copied

截屏2022-10-01 下午2.22.06.png

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