0 Replies Latest reply on May 27, 2008 2:21 PM by webquorning

    Print button-objects based on array data

    webquorning
      Hi all,
      In Flex, I have created a script that loads in some XML-data og saves an array of text nodes in an array:


      function loaderOnCompleteHandler(event:Event):void {
      var loader:URLLoader = event.target as URLLoader;
      if (loader != null)
      {
      externalXML = new XML(loader.data);
      trace("Response: " + externalXML.response.length());
      responsesArray = new Array();


      for (var j:int = 0; j < externalXML.response.length(); j++) {
      responsesArray[j] = externalXML.response[j].content;
      }

      trace(responsesArray.toString());
      }
      else
      {
      trace("loader is not a URLLoader!");
      }
      }

      So far, so good.
      Now, I have inserted a panel and an instance of a Button-object, to give you guys an idea of what I want:

      <mx:Panel title="Vælg response" horizontalAlign="center" verticalAlign="middle" width="50%"
      height="50%" horizontalCenter="-16" verticalCenter="-63">
      <mx:Button label="Button" cornerRadius="40" width="69" height="70"/>
      </mx:Panel>

      Now, I want to use the array data to insert a number of buttons, according to the length of the array.
      How is that possible?

      Thanks very much in advance,

      Lasse