Compiler warning messages identify code that is valid and compiles successfully, but may not be what the author intended. To enable detecting these possible problems, compile ActionScript projects in warning mode.

Some of these warnings (for example, "Missing type declaration.") are coding style choices that you have the option whether to enforce. Others (for example, "Impossible assignment to null.") point out statements that are valid, but are unlikely to behave as the user expects. A third class of warnings covers issues you may encounter when porting ActionScript 2.0 code to ActionScript 3.0.


 CodeMessageDescription
 1009_ '_' has no type declaration. This is a coding style preference. A function return type, parameter, or variable has no type declaration. Using type declarations enables the compiler to write more efficient code, as well as detect more errors at compile time. Enable this warning if you want to be reminded whenever you fail to use a type declaration.
 1013Variables of type _ cannot be undefined. The value undefined will be type coerced to _ before comparison. Only variables of type * can be undefined. With a few exceptions, uninitialized variables have a default value of null rather than undefined. The exceptions include: Boolean variables, which have a default value of false. Number variables, which has a default value of NaN, and int or uint variables, which have a default value of 0.
 1031Migration issue: Result of new _ will be the return value of _, rather than a new instance of that function. This is a code migration warning. The code detected behaves differently in AS3 than it did in AS2.
function f(){
   this.b = 22;
   this.a = new Array(2);  
   this.a[0] = 33;
   this.a[1] = 44;
   return a; 
   } 
   // returns a new instance of f in AS2 and a new 2 element array in AS3
   var d = new f();  // Warning here
   print(d.a);       // undefined in A3, [33,44] in AS2.
 1035Use of Boolean() with no arguments. This is a code migration warning. Boolean() returns false in ActionScript 3.0, but undefined in ActionScript 2.0.
 1039Migration issue: Number('') returns 0 in Actionscript 3.0, and NaN in Actionscript 2.0. This is a code migration warning. Number() called with a String argument will skip over all whitespace in the string and return a default value of 0 if no digits are detected. In Actionscript 2.0, any whitespace in the string will cause the result to be NaN.
 1045Migration issue: Array.toString() handling of null and undefined elements has changed. This is a code migration warning. In ActionScript 2.0, null array elements convert to 'null' and undefined elements convert to 'undefined'. In ActionScript 3.0 both null and undefined elements convert to the empty string ''. If you have code that parses the toString() output from an Array, you may need to adjust your code for this difference.
 1059Migration issue: The property _ is no longer supported. _. This is a code migration warning. The property you are attempting to use does not exist in ActionScript 3.0.
 1061Migration issue: The method _ is no longer supported. _. This is a code migration warning. The method you are attempting to use does not exist in ActionScript 3.0.
 1066__resolve is no longer supported. 
 1067Migration issue: __resolve is no longer supported. Use the new Proxy class for similar functionality. This is a code migration warning. See help for Proxy for more information on __resolve's replacement.
 1071Migration issue: _level is no longer supported. For more information, see the flash.display package. This is a code migration warning. The property you are attempting to use does not exist in ActionScript 3.0.
 1073Migration issue: _ is not a dynamic class. Instances cannot have members added to them dynamically. This is a code migration warning. In ActionScript 2.0, many classes such as Number were dynamic, which means that new properties can be added to instances of those classes at runtime. This warning is caused code which tries to add a property to an instance of a non-dynamic class.
 1083Migration issue: Method _ will behave differently in AS3 due to the change in scoping for 'this'. See help on warning 1083 for additional details. This is a code migration warning. This warning is triggered when a method of an object is used as a value, usually as a callback function. In ActionScript 2.0, functions are executed in the context they are called from. In ActionScript 3.0, functions are always executed in the context where they were defined. This means variable and method names are resolved to the class the callback is part of, rather than relative to the context it is called from.
class a 
{ 
   var x; 
   function a() { x = 1; } 
   function b() { print(x); } 
}

var A:a = new a();
var f:Function = a.b; // warning triggered here
var x = 22;
f(); // prints 1 in ActionScript 3.0, 22 in ActionScript 2.0
 1085_ will be scoped to the default namespace: _ internal. It will not be visible outside of this package. This is a coding style preference. Enable this warning if you want to be reminded when you forget to declare a namespace or access specifier for a definition. Without one, the definition will not be visible to code located outside of this file. To make it visible to code outside this file, declare it with the access specifier 'public' or with a namespace declaration. To keep the definition local to this file and avoid this warning, declare the definition as 'private'.
 1087Migration issue: ActionScript 3.0 iterates over an object's properties within a "for x in target" statement in random order. This is a code migration warning. In ActionScript 2.0, the order in which the properties of an object were processed was always the same. In ActionScript 3.0, the order is random and can change from machine to machine. If you experience odd ordering behavior, inspect this loop to determine if this change in behavior may affect your code.
 1089Error code: _. This is either due to a corrupt source file or a bug in the compiler code. Please file a bug!
 1091Migration issue: _ This is a code migration warning. In ActionScript 2.0 declaring a method by a special name (such as onMouseDown) would cause Flash to call that method when a certain event occurred. In ActionScript 3.0, you must call addEventListener with a method in order to register it to recieve that event. See addEventListener in the help for details.
 1093Negative value used where a uint (non-negative) value is expected. Assigning a negative value to a uint will result in an extremely large positive value. var x:uint = -1; print(x); // 4294967295
 1097Illogical comparison with null. Variables of type _ cannot be null. Instances of Boolean, int, uint, and Number can not be null. The comparision operator will type convert null to false before comparing it to a Boolean, or to 0 before comparing it with a Number, int, or uint.
 1099Illogical comparison with NaN. This statement will always evaluate to false. A unique mathemetical property of NaN is that any comparision involving it will evaluate to false. Use the global isNaN() function to detect a NaN value instead.
print(NaN == NaN); // false!
print(NaN != NaN); // false again!
print(isNaN(NaN)); // true
 1101Assignment within conditional. Did you mean == instead of =? The result of an = assignment statement is the value of the right hand side of the = statement. You can use an assignment statement as a conditional test, but it is not a recommended practice. It usually is the result of a typo where a == equality test was intended.
var x:Boolean = false;
var y:Boolean = true;
// it is hard to determine if the line below intentionally sets x's value to y's or if its a typo
if (x = y) { print("x is assigned y's value of true, making the conditional test evaluate as true."); }
 1103Impossible assignment to null. Variables of type _ cannot be null. Boolean, Number, int, and uint variables can not be assigned null as a value. null will be implicitly cast to false when assigned to a Boolean, and to 0 when assigned to an int, uint, or Number.
 1105No constructor function was specified for class _. This is a coding style preference. Enable this warning if you want to always declare constructors for classes. This warning is intended to help find cases where a class name is changed and its constructor's name is not. Conditions such as this will not be flagged as a problem without this warning, the former constructor will appear to be a normal function.
 1111The constant was not initialized. 
 1113Array(x) behaves the same as 'new Array(x)'. To cast a value to type Array use the expression 'x as Array' instead of Array(x). 
 1115The super() statement will be executed prior to entering this constructor. Add a call to super() within the constructor if you want to explicitly control when it is executed. This is a coding style preference. Enable this warning if you want to always be explicit about when super() will be called. This can help catch cases where you meant to call super() after some local initialization code and forgot to add it.
 3552Appending text to a TextField using += is many times slower than using the TextField.appendText() method. See help for TextField's appendText() method for details on this significant text optimization.
 3554Function value used where type _ was expected. Possibly parentheses() are missing after this function reference. You can use functions themselves as values in ActionScript. The code in question is using a value of type Function where a type other than Function, Object, or * is expected. Usually, this indicates a typo where '()' was omitted after the function name.
 3556The instanceof operator is deprecated, use the is operator instead. 
 3574Migration issue: The ActionScript 2.0 XML class has been renamed XMLDocument. This is a code migration warning. XML is a different class in ActionScript 3.0 than it was in ActionScript 2.0. The ActionScript 2.0 version of the class has been renamed as XMLDocument. The ActionScript 3.0 XML class offers improved functionality with an easier and more powerful API. For more information, see XML in the help for additional details.
 3576Date(x) behaves the same as new Date().toString(). To cast a value to type Date use "x as Date" instead of Date(x). 
 3582Importing a package by the same name as the current class will hide that class identifier in this scope. 
 3584More than one argument named '_' specified. References to that argument will always resolve to the last one. 
 3590Non-Boolean value used where a Boolean value was expected. 
 3591_ used where a Boolean value was expected. The expression will type coerced to Boolean. 
 3593_ is not a recognized property of the dynamic class _. The strict compilation mode will not check for undefined properties on instances of dynamic classes. The types Date, RegExp, and Error are dynamic for backwards compatability with ECMAScript. This warning finds usages of undefined properties on instances of those classes. A common problem is attempting to get or set a non-existant 'year' property on a Date value. The correct property name is 'fullYear'.
 3595_ is not a recognized method of the dynamic class _. The strict compilation mode will not check for undefined methods on instances of dynamic classes. The types Date, RegExp, and Error are dynamic for backwards compatability with ECMAScript. This warning finds usages of undefined methods on instances of those classes.