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
-
package {
-
public class Foo implements IFoo
-
{
-
public function Foo(){};
-
public function test():void{};
-
}
-
}
-
internal class myInternalClass{};
In your FLA just write
-
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
-
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 .
October 23rd, 2009 at 3:17 am
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
March 20th, 2010 at 8:19 am
Thank you for posting this. I would have never figured that out.
April 28th, 2010 at 9:16 pm
Thanks for this post. Saved me a ton of grief