dimanche 19 juin 2016

MovieClip Undefined?

I am trying to make a program where I can press a button to make a timer animation start. However whenever I add a try to add a MovieCLip to the stage it always says: Undefined... Why. Someone help me :(.

Here is my code:

var mc_hero:MovieClip = new hero_mc;
addChild(hero_mc);



var rectangle:Shape = new Shape; 
rectangle.graphics.beginFill(0xFF0000);
rectangle.graphics.drawRect(100, 100, 25,25); 
addChild(rectangle);

var circle:Shape = new Shape;
circle.graphics.beginFill(0x99ff00);
circle.graphics.drawCircle(90, 90, 25);
addChild(circle);


var moveleftTimer: Timer = new Timer(2000,10);
moveleftTimer.start();
moveleftTimer.addEventListener(TimerEvent.TIMER,moveleft);

function moveleft(event:TimerEvent):void 
{

}

Aucun commentaire:

Enregistrer un commentaire