views:

416

answers:

1

Hi!

I have a *.fla that gets its data from a xml file with some nodes.

What I really want to know is how can I change my text x and y positions via AS?

Thanks!!

+1  A: 

you probably have a for loop go through your nodes and get the data from xml, that is probably where you create your text ( TextField, Label, etc. )

if you're using a regular for loop you can change the positions there.

for(var i:int = 0 ; i < xmlNodes.length ; i++){
   var textField:TextField() = new TextField();
   addChild(textField);
   textField.y = textField.height * i;
}

if you're using a for each loop set a counter before the loop and increment it inside

var textFields:int = 0;
for each(var node:XML in xmlNodes){
var textField:TextField() = new TextField();
   addChild(textField);
   textField.y = textField.height * textFields;
textFields++;
}
George Profenza