06.23.08
ActionScript Error 1136: Incorrect number of arguments. Expected 1.
1136: Incorrect number of arguments. Expected 1.
ActionScript 3 Error #1136 Description:
This is a generic yet simple ActionScript Error. It just means that you need one and only one argument in the method you are calling. This error will pop up in many cases but I will only provide one code example. It should help you get through this fairly easily.
Flex / Flash Error 1136 Fix:
Add the applicable argument/parameter into the parenthesis.
Bad Code:
newempty1.removeChild();
Good Code:
newempty1.removeChild(pic1);
This should help you resolve Flex / Flash Error #1136
Thanks and as always Happy Flashing
Curtis J. Morley
Michael Sutton said,
July 20, 2008 at 9:23 am
Speaking of Error #1136… I don’t understand why it pops up on the very first line of my script:
var gameTimer: Timer = new Timer (3000, 26);
telling me it’s expecting 0 arguments!
I get no problems with a test file that eliminates everything but by timer code… declarations, function, etc. It works fine, does exactly what I want, no error messages. But when copied and pasted back into the main script, there’s that error message on the variable declaration!
P.S. There are no other Timer objects declared in the script.