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.