I have a small problem attaching clips on the stage with xml. Here is the xml and the code (simplified versions)
<xml>
<dots>
<item>
<X_positions>
<Xpos>100</Xpos>
<Xpos>120</Xpos>
<Xpos>130</Xpos>
</X_positions>
<y_positions>
<ypos>40</ypos>
<ypos>50</ypos>
<ypos>60</ypos>
</y_positions>
</item>
<item>
<X_positions>
<Xpos>200</Xpos>
<Xpos>220</Xpos>
<Xpos>230</Xpos>
</X_positions>
<y_positions>
<ypos>240</ypos>
<ypos>250</ypos>
<ypos>260</ypos>
</y_positions>
</item>
</dots>
</xml>
function xml_loaded(e:Event):void {
xmlData=new XML(e.target.data);
var dotList:XMLList=xmlData.item;
for each (var dot:XML in dotList) {
for each (var X_pos:XML in dots.X_postions.X_pos) {
var g=dots.X_postions.X_pos .length();
X_poslist=new Array;
X_poslist.push(X_pos)
}
for each (var Y_pos:XML in dots.Y_positions.Y_pos) {
Y_poslist=new Array;
Y_poslist.push(Y_pos)
}
for (var i=0; i<g; i++) {
dotclip_mc=attach_clip();
}
}
}
function attach_clip() {
dot_event=new dotclip_mc
dot_event.x=(X_poslist);
dot_event.y=(Y_poslist);
addChild(dot_event);
}
I have an array of xpositions and y-positions. I want to attach two lines of three dot clips each on the stage
Everything is working but I am just seeing two dot clips on the stage. It is just reading the last values in the array so I am guessing the three dots are in the same spot. How do I get it to read all three values of x and y positions?
Thanks in advance