# Loop through array to create XML objects

**URL:** <https://forum.kirupa.com/t/loop-through-array-to-create-xml-objects/195395>\
**Category:** flash\
**Created:** [July 31, 2006, 1:01pm UTC](https://forum.kirupa.com/t/loop-through-array-to-create-xml-objects/195395 "2006-07-31T13:01:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zaid\_W1red](https://avatars.discourse-cdn.com/v4/letter/z/cab0a1/32.png) [@Zaid\_W1red](https://forum.kirupa.com/u/Zaid_W1red)\
**Post date:** [July 31, 2006, 1:01pm UTC](https://forum.kirupa.com/t/loop-through-array-to-create-xml-objects/195395/1 "2006-07-31T13:01:16Z")

</div>

Hey Guys,  
IM trying to loops through an array to create an XML object for each item…I dont seem to be able to nail the syntax though!

The code Im using is below…can anyone help?  
[AS]  
var sections:Array = [“newsXML”,“showsXML”];

for(var i:Number = 0; i \< sections.length; i++){  
var tempObj+""+i:XML = new XML();  
}  
[/AS]
