vendredi 20 novembre 2015

Get item/variable from array with string AS3

so I have an array with 4 string values in it (defined before array like public var p1:String etc)

public var partArray:Array = 
[
    p1 = ""
    p2 = ""
    p3 = ""
    p2_3 = ""
];

Lets say I have a textbutton with the name of one of these variables, how would I get the correct variable from the array using the name of the textbutton.

Aucun commentaire:

Enregistrer un commentaire