1 Reply Latest reply on Nov 3, 2009 1:17 AM by Shivik

    Binding data in a TaskBar from an external xml file

    Shivik Level 1

      Hello all

       

      I am using Flex 3.4 and creating a TabBar control. I am going to use an external XML file for the TabBar labels.

       

      I have got the problem solved in tits and bits.

       

      • I created a ActionScript (Singleton) class as data model.
      package {
           public class DataModel {
                private var _item:String;
                private var _position:String;
                
                public function get item():String {
                     return _item;
                }
                public function set item(value:String):void {
                     _item = value;
                }
                public function get position():String {
                     return _position;
                }
                public function set position(value:String):void {
                     _position = value;
                }
                public function DataModel() { }
           }
      }
      

       

      • I created an external xml file which contains the data
      <?xml version="1.0" encoding="utf-8" ?>
      <params>
           <param item="Soap" position="1" />
           <param item="Clothes" position="2" />
           <param item="Detergent" position="3" />
           <param item="Dishwash" position="4" />
      </params>
      

       

      • I have the code for URLLoader to load the external file at runtime.

       

      Now how should I use the URLLoader to store the XML data from external file into the data model?

       

      Any help would be welcome

       

      thanks and regards

      Shivik