Link to home
Start Free TrialLog in
Avatar of jockmahon01
jockmahon01Flag for United States of America

asked on

replacing eval

i want to access a element of a object using the name, i original taught that eval would do the job but its been depricated so adobe suggent using syntax this['blah' + i ]
i have tried this but it aint working

            trace(i )     // is equal to name
            trace(  printLabelArray[pi].dispensingItemPrintElementdrug.templateElementText.text)  // prints John
                        trace(  this["printLabelArray[pi].dispensingItemPrintElement"+i]) // i get undefined here
                        trace(  this["printLabelArray[pi].dispensingItemPrintElement"+i+".templateElementText.text"] ) // and here

ASKER CERTIFIED SOLUTION
Avatar of jockmahon01
jockmahon01
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial