ActionScript 3 Error #1061

ActionScript 3 Error #1061: Call to a possibly undefined method addEvent through a reference with static type flash.utils:Timer.

ActionScript 3 Error #1061 Description:
AS3 error 1061 appears when you have misspelled a property or function and have not assigned a value to it. If you haven’t properly typed the Object to begin with you will get AS3 Error 1069. See the examples below. AS3 error 1061 is actually pretty nice to work with because it tells you exactly which method/property didn’t work and it tells you which object it didn’t work on.

Flash / Flex Error 1061 Fix:
Find the object listed in the error and then check the spelling after the dot.

Bad Code 1:

var t:Timer = new Timer(1000, 60);
t.addEvent(TimerEvent.TIMER, Tick);

Good Code 1:

var t:Timer = new Timer(1000, 60);
t.addEventListener(TimerEvent.TIMER, Tick);

Related ActionScript Error(s):
Flash / Flex Error 1069
– You will get AS3 Error 1069 instead of 1061 if you don’t properly type your object before referencing a property on it. For example var t:Timer = new Timer(1000, 60);
t.addEvent(TimerEvent.TIMER, Tick); will give error 1061 but var t = new Timer(1000, 60);
t.addEvent(TimerEvent.TIMER, Tick); will give Error 1069.
Flash / Flex Error 1119
The dreaded AS 3 Error 1119
Flash / Flex Error 1056
– This is the error you will get if you try and call a property with a misspelled name in the same way as calling a property with a misspelled name.

2 thoughts on “ActionScript 3 Error #1061

  1. vid.stop();

    b1.addEventListener(MouseEvent.CLICK, launchRocket);
    b2.addEventListener(MouseEvent.CLICK, launchRocket2);
    b3.addEventListener(MouseEvent.CLICK, launchRocket3);

    function launchRocket(event:MouseEvent):void{
    vid.play();

    }

    function launchRocket3(event:MouseEvent):void{
    vid.pause();

    }

    function launchRocket2(event:MouseEvent):void{
    vid.gotoAndStop(1);

    }

    1061: Call to a possibly undefined method gotoAndStop through a reference with static type fl.video:FLVPlayback.

    for vid.gotoAndStop(1)

  2. hi, I have a problem that i have been stumped on for about a day now.

    I keep getting these errors and i dont know what to do:

    1061: Call to a possibly undefined method hitTestPoint through a reference with static type Class.

    1061: Call to a possibly undefined method gotoAndStop through a reference with static type Class.

    Here is the code:

    function checkCollision(event:Event) {
    if (AnimatedObject.hitTestPoint(MascotX, MascotY, true)) {
    theGame.gotoAndStop(3)

    any help?

Comments are closed.