10.16.08

ActionScript Error 1184: Incompatible default value of type int where String is expected.

Posted in Adobe, Error, Error, errors, Flash, Flash 10, Flex at 9:04 pm by Curtis J. Morley

ActionScript Error 1184: Incompatible default value of type int where String is expected.

ActionScript Error 1184 Description:
This error is quite simple.  It just says that you have the wrong type of data in your parameter initializer.  Or in other words you tried to assign a string where you typed the parameter as a uint.

Flex / Flash Error #1184 Fix:
Match the parameter type to the proper data type.

Bad Code 1:

bob(someValue:uint = "Happy")
{
trace(someValue);//error 1184
}

Good Code 1:

bob(someValue:uint = 5)
{
trace(someValue);//output 5
}

Related Errors:

AS3 Error 1047

This should help you resolve Flex / Flash Error #1184

Thanks and as always Happy Flashing

Curtis J. Morley

2 Comments »

  1. curtismorley.com » ActionScript Error 1047: Parameter initializer unknown or is not a compile-time constant. said,

    October 23, 2008 at 4:07 pm

    […] AS3 Error 1184 […]

  2. Jeff said,

    June 1, 2010 at 1:26 pm

    This also happened to me when I tried to make an int be null as an optional param in a function call. Not allowed but you can do this:

    http://stackoverflow.com/questions/1003100/why-cant-typed-optional-arguments-have-a-default-of-null

Leave a Comment