Skip to main content
Participant
March 16, 2021
Answered

Working with multple dynamic text fields

  • March 16, 2021
  • 1 reply
  • 335 views

Hi, I am currently working on displaying some Patches in Animate.

Is there a way to controll multiple dynamic text fields with one line of code?

 

My example: 3 dynamic text fields with the instance name myText

and the according code snipped: this.myText.visible=false;

 

Unfortunaly only the first myText diapears.

Can someone help me how to let the other two texts disapear?

 

This topic has been closed for replies.
Correct answer ClayUUID

Specifically, never use the same name for multiple objects within the same object. For example:

 

NO, OF COURSE THIS WON'T WORK:

myClip.text1

myClip.text1

myClip.text1

 

WORKS FINE:

myClip1.text1

myClip2.text1

myClip3.text1

 

1 reply

kglad
Community Expert
Community Expert
March 16, 2021

never use the same reference for different objects.  ie, change your textfield names (eg, tf1, tf2 etc)

ClayUUIDCorrect answer
Legend
March 16, 2021

Specifically, never use the same name for multiple objects within the same object. For example:

 

NO, OF COURSE THIS WON'T WORK:

myClip.text1

myClip.text1

myClip.text1

 

WORKS FINE:

myClip1.text1

myClip2.text1

myClip3.text1