# Creating Variable and its Class from XML Parsed Data

**URL:** <https://forum.kirupa.com/t/creating-variable-and-its-class-from-xml-parsed-data/285924>\
**Category:** flash\
**Created:** [April 7, 2009, 8:53pm UTC](https://forum.kirupa.com/t/creating-variable-and-its-class-from-xml-parsed-data/285924 "2009-04-07T20:53:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aspivey](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@aspivey](https://forum.kirupa.com/u/aspivey)\
**Post date:** [April 7, 2009, 8:53pm UTC](https://forum.kirupa.com/t/creating-variable-and-its-class-from-xml-parsed-data/285924/1 "2009-04-07T20:53:32Z")

</div>

Hi,  
I’ve set up an XML file with names of objects that will be contained in my fla/swf library. I wish to position the objects on the stage at runtime using an XML file that can be quickly modified without having to recompile the fla/swf file. Of course, positioning can only be accomplished when the objects are instantiated and added to the stage. The problem is passing the parsed XML file name/class paring data into the var creation programatically.  
The XML file contains the object names and class: simple example follows:  
\<objects\>  
\<object name=“myBall” class=“Ball”/\>  
\</objects\>  
The XML file parses correctly and I’ve set up a …for…each loop to assign the name/class to each object. The problem is with the proper syntax to input the name/class paring, something similar to the following:

var object.@name:object.@class = new object.@class();

Am I off my rocker with this or just temporarily ignorant??? :dilbert:

Thanks for any response - Arch
