ArgumentError: Error #2025: El objeto DisplayObject proporcionado debe ser un elemento secundario del llamador.
at flash.display::DisplayObjectContainer/removeChild()
at MethodInfo-8()
Lo estoy buscando en los foros, pero no encuentro como solucionarlo.
Please ayuda, os dejo el codigo, es para crear humo.
Gracias
Código :
var fadeSpeed = .01;
var floatUpSpeed = 2;
;
this.addEventListener(Event.ENTER_FRAME, crearHumo);
function crearHumo(e:Event){
var humo:aPuff = new aPuff();
this.addChild(humo);
humo.alpha = .8;
humo.scaleX = 0.1;
humo.scaleY = 0.1;
humo.x = Math.random()*2;
humo.gotoAndPlay(Math.round(Math.random()* 20));
humo.addEventListener(Event.ENTER_FRAME, propHumo);
function propHumo(e:Event){
humo.scaleX += fadeSpeed;
humo.scaleY += fadeSpeed;
humo.alpha -= fadeSpeed;
humo.y -= floatUpSpeed;
humo.x += floatUpSpeed;
if(humo.scaleX >= .8){
removeChild(humo);
}
}
} 