I need to receive a variable with multiple values from php in as3,
the variable is
$errors = "1, 4, 5"
but it changes the values.
I need to take the values and , “read” them and depending on what values there are I’m supposed highlight corresponding fields, like errors gives me 1
er_1.gotoAndStop(2);
er_1.visible = true;
this would be easy with a simple if{} if I was receiving 1 value but I don’t know how to check for multiple values, please help?
If your values are separated by commas (or any common string), you can split a string along that comma to get an array of strings.
Example:
Note that all the values inside error are still strings, so you may need to parse them back into ints.