Ver Mensaje Individual
  #2 (permalink)  
Antiguo 15/11/2010, 19:57
Avatar de TMeister
TMeister
Crazy Coder
 
Fecha de Ingreso: enero-2002
Ubicación: En la Oficina
Mensajes: 2.880
Antigüedad: 22 años, 3 meses
Puntos: 193
Respuesta: Instanciar objetos dinamicamente

Para lo primero:
Código actionscript:
Ver original
  1. import flash.utils.getDefinitionByName;
  2.  
  3. for (var i:int = 0; i<2; i++)
  4. {
  5.     var tmpClass = getDefinitionByName( 'ball' + i );
  6.     var tmpBall = new tmpClass();
  7.     tmpBall.x = Math.random() * stage.stageWidth;
  8.     tmpBall.y = Math.random() * stage.stageHeight;
  9.     addChild( tmpBall )
  10. }

Obviamente esto necesita 2 clips en la librería llamados ball0 y ball1 para lo segundo no entendí bien pero tal vez esto te sirva. http://www.forosdelweb.com/f16/trata...1/#post3636760

Saludos