PDA

View Full Version : attach symbol in library to the stage using pixel value from XML file.


thou
09-01-2006, 03:30 AM
I have an XML file which I parse using XMLCOnnector and bindings all those data to the ComboBox and TextArea’s on the stage (using component Inspector). Student name will appear in combobox dropdown and it will change the others textArea when select different value. It works great.

The problem arisen when i some nice lil idea..:p . The thing is I want to attach the id no with the symbol in Library and place it on the stage according to their respective horizontal and vertical pixel value in xml file (Some kind of attachMovie and loop through child nodes stuff). It become a big problem when I fail to figure it out to do just that:o

xml file.
<?xml version="1.0" encoding="UTF-8"?>
<class>
<student name="Micheal Hanks">
<id no="m5" tall="1.7 m" wg="85 kg" ctry="USA" grade="B-" horizontal="300" vertical="700 " img="pic/micheal1.jpg"/>
</student>
<student name="Andrea Koizumi">
<id no="m13" tall="1.6 m" wg="65 kg" ctry="France" grade="B" horizontal="700 " vertical="350" img="pic/andrea.jpg"/>
</student>
<student name="Ian Deiss">
<id no="ms5" tall="1.8 m" wg="70 kg" ctry="Switzerland" grade="A" horizontal="200" vertical="500" img="pic/ian.jpg"/>
</student>
</class>

thou
09-01-2006, 07:28 AM
i mean dynamic attach at runtime ..

thou
09-04-2006, 03:37 AM
hmm how can i loop in child node and attach the MC dynamically and place it across the stage using the _x adnd _y value drive from xml file. If possible i also want thaose attached MC's (sitting across the stage) been assign with instance name of id(from xml), so that i can target them latter(using button etc.)


<?xml version="1.0" encoding="UTF-8"?>
<CLASS>
<student name="Micheal Hanks" id="m001" tall="1.7 m" wg="85 kg" ctry="USA" grade="B" horizontal="300" vertical="700 " img="pic/micheal.jpg"/>
<student name="Andrea Koizumi" id="m002" tall="1.6 m" wg="65 kg" ctry="France" grade="B" horizontal="700 " vertical="350" img="pic/andrea.jpg"/>
<student name="Ian Deiss" id="ms005" tall="1.8 m" wg="70 kg" ctry="Switzerland" grade="A" horizontal="200" vertical="500" img="pic/ian.jpg"/>
</CLASS>