I thought I had got the hang of this but no…
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.*;
public class Test extends Sprite {
private var _diffClass:aDifferentClass;
public function Test()
{
innit();
stage.addEventListener(MouseEvent.CLICK, changeSomething);
}
private function innit():void
{
var _diffClass= new aDifferentClass();
_diffClass.x = 0;
_diffClass.y = 0;
addChild(_diffClass);
}
private function changeSomething(e:Event):void
{
removeChild(_diffClass);
innit();
}
}
}
I want it so that when the stage is clicked, the _diffClass child which has been added already is deleted and then added again (with different values, but i havent added all that as to make this example simplier). I get the error: Error #2007: Parameter child must be non-null.
thanks
dai