Hi list, I'm creating a framework in my job and I have reached this configuration:

-Class1
-Class2 extends Class1
-Class3 extends Class2
-Class4 extends Class3
-Class5 extends Class4

Class1 defines a method, for example "method1".
Class2 overrides the method and calls "super.method1".
Class5 overrides the method and calls "super.method1".

When a instance of Class5 is created, and calls "method1", method1 is called twice in Class2, wtf?

You can reproduce the bug using this sample classes:
<code>
class Class1 {
   public function method1():Void {
       trace("class1 method1");
   }
}

class Class2 extends Class1 {
   public function method1():Void {
       trace("class2 method1");
       super.method1();
   }
}

class Class3 extends Class2 {
}

class Class4 extends Class3 {
}

class Class5 extends Class4 {
   public function method1():Void {
       trace("class5 method1");
       super.method1();
   }
}
</code>

And this in the main timeline:
<code>
var a:Class5 = new Class5();
a.method1();
</code>

The output is something like this:
class5 method1
class2 method1
class2 method1
class1 method1

:-/
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to