Reputation: 11
I want to replicate this operation in 16 elements with the same final number and the same root, is there any way to do?
this is my try
for (var i:Number=1; i<=16 , i++)
{
this("masInfo"+i).x=this("btn"+i).x
this("masInfo"+i).y=this("btn"+i).y
}
Upvotes: 1
Views: 29
Reputation: 1016
I believe what you are trying to do is this.
for (var i:Number=1; i<=16 , i++)
{
this["masInfo"+i].x = this["btn"+i].x
this["masInfo"+i].y = this["btn"+i].y
}
Upvotes: 1
Reputation: 3157
Create a class with a static function that has two string parameters, in this case would be "masInfo" and "btn", or whatever you want to put in those parameters.
Upvotes: 0