Air/Flex concatenating a variable with a property

Posted by Deyon on Stack Overflow See other posts from Stack Overflow or by Deyon
Published on 2010-04-08T14:28:35Z Indexed on 2010/04/08 14:33 UTC
Read the original article Hit count: 181

Filed under:
|
|

I have three text boxes on the stage id=red, blue, green same as the keys in my cars Object/Array

    public function carsToBox():void
    {
        var cars:Object={red:"300zx",blue:"Skyline",green:"Supra"};

            for(var tempObj:String in cars)
            {
                tempObj.text= cars[tempObj];//this trows errors
            }
    }

So I'm thinking "tempObj.text" would equal red.text but I can't stick "tempObj" with ".text" is there a way this can be done?

© Stack Overflow or respective owner

Related posts about air

Related posts about flex