BeInteractive! (blog written by Yoshihiro Shindo) reported a bug of “private” classes (defined outside of the package block). Two or more “private” classes might cause a compile error, which tells that a local variable declared in a main class (inside the package) is undefined in Flash CS4 Professional.

1120: Access of undefined property s.

Compile error #1120

Compile error #1120

I found another condition of the error. If a “private” class inherits a class other than Object the compile error will be prevented.

package {
	import flash.display.Sprite;
	public class PrivateClassIssue extends Sprite {
		public function PrivateClassIssue() {
			var s:String = 'hello';
			trace(s);
		}
	}
}
class Foo {}
class Bar extends Array {}  // inherits Array class