Stopping my object [newb]
I have an ball that moves across the screen and it works fine.
Now I am trying to add code that will stop it when I click the mouse button.
When I run the movie my clicks do nothing.
Can someone look at my code and tell me where I am going wrong?
Thank you.
<code>
package {
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
public class Soccer extends MovieClip {
public function Soccer(){
this.addEventListener(Event.ENTER_FRAME,update);
this.addEventListener(MouseEvent.CLICK, clickHandler);
}
private function updatePosition():void {
this.x++;
this.y++
}
private function update(e:Event): void {
this.updatePosition();
}
public function clickHandler(evt:MouseEvent): void {
this.stop();
}
}//close constructor
}//close package
</code>