Skip to main content
Participant
November 1, 2018
Answered

Advanced Layers: How to reference layers as objects in ActionScript?

  • November 1, 2018
  • 1 reply
  • 575 views

I have a dynamic text field that was working fine, and still works as long as I turn off Advanced Layers.

However, I would like to fix my code, but so far, I haven't figure out how to refer to the layers in action script so I can update the path to my dynamic text field.

Take the following piece of code as an example:

txt_output.text = nameIn;

I need to add the layer name before the txt_ouput instance but so far, I have no idea how to refer to the layer.

Any help is appreciated it.

This topic has been closed for replies.
Correct answer UDESCO

I ran a quick test for editing the text of a dynamic text-field using the same code as above (with advanced layers enabled) and it worked fine. Can you share your test file to have a look.

In general, you should be able to access the layers using the layer name itself (this.Layer1), provided the layer name is a valid identifier and is not repeated.

1 reply

UDESCO
Adobe Employee
UDESCOCorrect answer
Adobe Employee
November 2, 2018

I ran a quick test for editing the text of a dynamic text-field using the same code as above (with advanced layers enabled) and it worked fine. Can you share your test file to have a look.

In general, you should be able to access the layers using the layer name itself (this.Layer1), provided the layer name is a valid identifier and is not repeated.