I have been away from actionscript for a long time and not 100% why this is happening, I will simplify the class below:
package{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
public class OpiaRobot extends MovieClip{
public function OpiaRobot(){ }
public function botAction(e:MouseEvent):void{ }
public function run(e:Event):void{
this.botaction();
}
}
var opiaBot:OpiaRobot = new OpiaRobot();
The call to botaction causes:
call to a possibly undefined method through a refernce with a static type?
Why as it should be an instance? Any help is appreciated.
If that is your exact code, it’s probably because you try to use
botaction()when you should usebotAction(MouseEvent).