Prionkor
02-04-2010, 10:28 AM
Hi,
Let i have 5 instants of a class say class_1 in the stage which i add by for loop. here is the code:
xPositions:Array = new Array(75, 175, 275, 75, 175, 275, 75, 175, 275);
var yPositions:Array = new Array(75, 75, 75, 175, 175, 175, 275, 275, 275);
for(var i:uint = 0; i < 8; i++){
var thisOne:GameButton = new GameButton();
addChild(thisOne);
thisOne.x = xPositions[i];
thisOne.y = yPositions[i];
}
now it want to select an object and then when i click in the any point in the stage i want to the selected object to tween there.
I know how to use Tween class. But problem is how do i get the name of the instant
here is the code for tween i used. The name of the selected object will be in the 'name of the object'. I can not retrieve the name of the clicked object.
new Tween(name of the object, "x", None.easeIn, xPosition, mouseX, 1, true);
new Tween(name of the object, "y", None.easeIn, yPosition, mouseY, 1, true);
please help!
Let i have 5 instants of a class say class_1 in the stage which i add by for loop. here is the code:
xPositions:Array = new Array(75, 175, 275, 75, 175, 275, 75, 175, 275);
var yPositions:Array = new Array(75, 75, 75, 175, 175, 175, 275, 275, 275);
for(var i:uint = 0; i < 8; i++){
var thisOne:GameButton = new GameButton();
addChild(thisOne);
thisOne.x = xPositions[i];
thisOne.y = yPositions[i];
}
now it want to select an object and then when i click in the any point in the stage i want to the selected object to tween there.
I know how to use Tween class. But problem is how do i get the name of the instant
here is the code for tween i used. The name of the selected object will be in the 'name of the object'. I can not retrieve the name of the clicked object.
new Tween(name of the object, "x", None.easeIn, xPosition, mouseX, 1, true);
new Tween(name of the object, "y", None.easeIn, yPosition, mouseY, 1, true);
please help!