Hi, im fairly new to As3 and have been slowly teaching myself As3. In the past I have been
coding in the timeline, which i know, is a big no no, but today i’ve started learning how to write external classes and i figured id try and make one of my simple timeline scripts into a custom class. The class traces the X and Y location of the mouse, and it works fine when i only have it check the location once. Logically i needed to make it update when the mouse moves because its nearly worthless like it was, so i added an event listener to the function containing the trace, but for some reason now whenever i test it and i move the mouse i get this error " ArgumentError: Error #1063: Argument count mismatch on MouseTracker/xyupdate(). Expected 0, got 1."
package {
import flash.events.MouseEvent;
import flash.display.MovieClip;
public class MouseTracker extends MovieClip {
public function MouseTracker():void {
stage.addEventListener(MouseEvent.MOUSE_MOVE, xyupdate);
}
public function xyupdate():void {
trace("( " + mouseX + " , " + mouseY + " ) " );
}
}
}
any idea why this isn’t working? thx