Today I came across a very unusual problem. While compiling an old Flash CS3 project in Flash CS4, Compiler thew an error saying "1044: Interface method {Methodname} in namespace {InterfaceName} not implemented by class {ClassName}." while in CS3 the same project complied without any problem. Class was implementing an Interface and an internal Class was defined in the same .as file. After some debugging I found that if you Implement an Interface and defined an Internal class within same file, then CS4 will not compile the FLA and will throw the error. Here is an example you can try in CS4.

create an interface IFoo with function definition test. create a Class Foo which implements IFoo and defined function test.

Class Foo

Actionscript:
  1. package {
  2. public class Foo implements IFoo
  3. {
  4. public function Foo(){};
  5. public function test():void{};
  6. }
  7. }
  8. internal class myInternalClass{};

In your FLA just write

Actionscript:
  1. var a:Foo = new Foo();

If you try to compile this file, compiler will throw en error
"1044: Interface method test in namespace IFoo not implemented by class Foo." If you remove the internal Class definition

Actionscript:
  1. internal class myInternalClass{};

Fla will compile without any problem.

This is a bug in CS4, so make sure that if your Class is implementing an Interface and need to use an internal class, declare that internal class in a separate class file .

3 Responses to “Flash CS4: Cannot use Interface and internal class both in single AS file”

  1. uberVU - social comments Says:

    Social comments and analytics for this post

    This post was mentioned on Twitter by activein: Flash CS4 bug: Cannot use Interface and internal class both in single AS file http://bit.ly/xQYaf

  2. Eric Smith Says:

    Thank you for posting this. I would have never figured that out.

  3. evevanan Says:

    Thanks for this post. Saved me a ton of grief

Leave a Reply