0

I'm a little new to flex builder. I have a xml file successfully imported in my program. But I want it to be possible to add items to it. I figured it had to be with insertChildAfter. This is what I got, but it won't work and can't find the solution.

example XML-structure:

<deelnemers>    
  <deelnemer>   
   <totem>timka</totem>
   <aantalActiviteiten>2</aantalActiviteiten>
   <actID>0</actID>
   <actID>1</actID>
  </deelnemer>  
  <deelnemer>   
   <totem>hop</totem>
   <aantalActiviteiten>3</aantalActiviteiten>
   <actID>0</actID>
   <actID>1</actID>
   <actID>3</actID>
  </deelnemer>  
</deelnemers>

function:

    protected function button1_clickHandler(event:MouseEvent):void{
      totem = myTotem.text; //Get information out of inputField
      deelnemers.insertChildAfter(<totem>{totem}</totem>,
                                  <actID>{ID}</actID>);
    listDeelnemers.refresh();}              
ketan
  • 19,129
  • 42
  • 60
  • 98
Lammar
  • 1
  • You should explain more about what isn't working exactly. – Thomas Jul 08 '13 at 08:30
  • Well, the function isn't adding the item. so the purpose of the function is to add {number} after {totem} but it does nothing – Lammar Jul 08 '13 at 08:31
  • See this QA: http://stackoverflow.com/questions/5942414/trouble-with-insertchildafter-for-xml-in-actionsctipt-3 – spring Oct 06 '15 at 20:30

0 Answers0