Question
Drawing API
Hi
I know I'm being thick here, but I can't work this out for the life of me. I'm trying to get the following code to work when a button is pressed. I substitute the ENTER_FRAME code with a MouseEvent licked to a Movie Clip, but nothing happens. I don't get any error code, just nothing. Please can anybody help?
var xspeed:Number = 2; var yspeed:Number = -2; var xpos:Number = 0; var ypos:Number = stage.stageHeight; graphics.lineStyle (2, 0xffffff); graphics.moveTo (0, stage.stageHeight); addEventListener (Event.ENTER_FRAME, onEnterFrame); function onEnterFrame (event:Event):void { xpos += xspeed; ypos += yspeed; graphics.lineTo (xpos, ypos); }
Matthew