1 Reply Latest reply on Jul 23, 2009 9:58 AM by Flex harUI

    using dictionary (the class)




      I am trying to create an array of 10 line item inputs. I need my client to be able to add up to 10 orders at a time with sku#, quantity and price fields. I do not want to create these manually, but dynamically with AS3. I have never used the Dictionary Class before, but I am thinking it may be helpful in this situation.





      var items:Dictionary= new Dictionary();



      private function initPage():void {

           //Create 'container'


           var container:HBox= new HBox();


           var input_number:TextInput= new TextInput();


           var input_quantity:NumericStepper= new NumericStepper();


           var input_price:TextInput= new TextInput();





           //Add container to 'items'


           for(var i:int= 0; i<10; i++){


                //Add to mx:Box 'box_items'





      This is my idea of how I can render these items on the page, though I am obviously wrong because it does not work. I basically have an HBox with 3 children, and trying to add that complex object to the Dictionary so it is indexed. That way if I want to access the value of the 3rd item_number text field I could use something like:




      Am I on the right track? What am I missing?


      Thanks much,