I try to use addChild in my MovieClip but doesn't work
private function material():MovieMaterial
{
var mc:MovieClip = new WorldMaterial(); //movieclip
inside the
library flash.
var objectMap:ObjectMap = new ObjectMap("newMap"); //
Class extends
MovieClip
objectMap.graphics.beginFill(0x000000);
objectMap.graphics.drawCircle(0,0,500);
objectMap.graphics.endFill();
mc.addChild(objectMap);
var sp:Sprite = new Sprite();
sp.addChild(mc);
worldMat = new MovieMaterial(sp);
return worldMat
}
private function initWolrd():void
{
var div:int = 35;
// this line create the world
world = new Sphere({segmentsH:div,segmentsW:div,radius:
80,material:material()});
scene.addChild(world);
}
I can't add child if the movieclip is inside the flash library ????