I have three text boxes on the stage id=red, blue, green same as the keys in my cars Object/Array
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo" creationComplete="carsToBox()">
<fx:Script>
<![CDATA[
public function carsToBox():void{
var cars:Object={red:"300zx",blue:"Skyline",green:"Supra"};
for(var tempObj:String in cars)
{
tempObj.text= cars[tempObj];
}
}
]]>
</fx:Script>
<s:TextInput x="65" y="53" id="red"/>
<s:TextInput x="64" y="88" id="blue"/>
<s:TextInput x="64" y="118" id="green"/>
</s:WindowedApplication>
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?