Hi Community,
i try to call some cubes i generate through a loop by a variable cube.name = “cube”+var for tweening.
for (var cubePerB:Number = 1; cubePerB <= katButtonsCount - 1; cubePerB++)
{
cube = new Mesh(new CubeGeometry(50, 50, 50, 1, 1, 1, true) , redMaterial);
scene.addChild(cube);
cube.name = "cube"+cubePerB;
TweenLite.to(cube, 6, { x:Math.random () * 400, y:Math.random () * 400, z:Math.random () * 400, onComplete: randomAnimationCubes } );
}
the initial Animation works - and i understand why - but if im trying to call them after generating by the name the Tweener doesnt recognize them.
can somebody explain me why ?