I think this is an easy one.
We're looking for help with a script that will hide all instances of text fields that contain a certain value. We have a function running that applies to the same text fields, however, each text field had to be tagged with a number at the end. Also running with this is a custom save button that flattens the page and hides certain elements before saving out. The hide function works pretty straightforward with "this.getField… = display.hidden;". The issue is that we don't want to repeat this for every single instance of the text fields that share the same name.
We need it look for every text box that has a similar title so for instance if we had multiple fields like this… "my-text-field-01", "my-text-field-02" and "my-text-field-03" we want the script to look for the name "my-text-field" and hide all instances of that.
Hope this makes sense, sorry, our programming skills are still amateur. Thanks in advance for any help.
You can do that if you use a heirarchical naming convention. So instead use something like: my-text-field.1, my-text-field.2, etc.
You can then hide them all like:
// Hide all of the "my-text-field" fields getField("my-text-field").display = display.hidden;
Ahhh, that's great to know! Thanks a lot George, you've been a huge help.