06.30.08

AS3 Error 1188: Illegal assignment to class Boolean.

Posted in Adobe, Error, Error, errors, Flash, Flex at 6:04 am by Curtis J. Morley

ActionScript Error #1188: Illegal assignment to class Boolean.

ActionScript Error #1188: Illegal assignment to class Number.

ActionScript Error #1188: Illegal assignment to class int.

ActionScript Error #1188: Illegal assignment to class uint.

ActionScript Error #1188: Illegal assignment to class String.

ActionScript Error #1188: Illegal assignment to class Array.

ActionScript Error #1188: Illegal assignment to class Object.

ActionScript 3 Error #1188 Description:

AS3 error 1188 is thrown when the keyword "var" is omitted. Adobe doesn't offer any documentation on this ActionScript Error and the description itself is no help at all. This error will be thrown whenever the "var" keyword is missing on all variable assignments including a custom Class/Data Type. I have never experienced this error without also getting AS3 Error 1067 first.

Flex / Flash Error 1188 Fix:
Don't forget the var when you define a new variable.

Bad Code:

import com.errors.CustomObj
myCustomObj:CustomObj = new CustomObj();
myObj:Object = new Object();
myBool:Boolean = false;
myint:int = -1;
myString:String = "Happy Flashing";
myArray:Array = new Array();

Good Code:

import com.errors.CustomObj
var myCustomObj:CustomObj = new CustomObj();
var myObj:Object = new Object();
var myBool:Boolean = false;
var myint:int = -1;
var myString:String = "Happy Flashing";
var myArray:Array = new Array();

Related Errors:

ActionScript Error 1067

This should help you resolve Flex / Flash Error #1188
Thanks and as always Happy Flashing

Curtis J. Morley

2 Comments »

  1. John Funk said,

    July 8, 2008 at 8:51 am

    Hey Curtis!
    Send me an email with your new contact info. 🙂

  2. Drew Taylor said,

    July 9, 2008 at 10:54 am

    Hey Curtis, I was talking to Jacob Wright recently who mentioned that you
    are no longer with MediaRain. I would love to touch base again and see what
    you are up to these days. Shoot me your new contact info.

    Cheers,

    Drew

Leave a Comment