Re: [Flashcoders] Inheritance bug in AS2 Flash 8

2006-09-29 Thread Eric Priou

Something related to :
http://lists.motion-twin.com/pipermail/mtasc/2006-September/029975.html
?

---
Eric Priou
(aka erixtekila)
In progress tech blog : http://blog.v-i-a.net/
Oregano XML Socket forum : http://forum.v-i-a.net/

___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] Inheritance bug in AS2 Flash 8

2006-09-28 Thread Hans Wichman

Hi,
not 3 times? I don't think its being called twice in class2, class5's
superclass is class 4, which doesnt not redefine class2's method.
Let class 5 extend class2 for testing purposes, it probably will work
correctly and introduce class3 to see what it does. Then override method1 in
class 3 to see what it does.

greetz
JC


On 9/28/06, Miguel Angel Sánchez [EMAIL PROTECTED] wrote:


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

:-/
___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] Inheritance bug in AS2 Flash 8

2006-09-28 Thread Miguel Angel Sánchez
Save the example classes in a folder and look at the output console in 
Flash. You will see:


class5 method1
class2 method1
class2 method1
class1 method1

This doesn't have any sense.

If you override the method in class4, or in class3, like this, it works 
fine:


code
Class4 extends Class3 {
   public function method1():Void {
   super.method1();
   }
}
/code
The output in this case is:
class5 method1
class2 method1
class1 method1

But I don't wanna override the method in Class3 nor Class4 to do nothing 
but call super, because is not needed in a OOP language.


Hans Wichman escribió:

Hi,
not 3 times? I don't think its being called twice in class2, class5's
superclass is class 4, which doesnt not redefine class2's method.
Let class 5 extend class2 for testing purposes, it probably will work
correctly and introduce class3 to see what it does. Then override 
method1 in

class 3 to see what it does.

greetz
JC


On 9/28/06, Miguel Angel Sánchez [EMAIL PROTECTED] wrote:


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

:-/
___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] Inheritance bug in AS2 Flash 8

2006-09-28 Thread Hans Wichman

Hi,
it's discussed here as well, ut i do not know of a fix other than that
described in the post below.
If you dig into the nitty gritty prototype chain information available on
flash you might be able to fix it.

http://chattyfig.figleaf.com/pipermail/flashcoders/2004-January/101029.html

greetz
JC


On 9/28/06, Miguel Angel Sánchez [EMAIL PROTECTED] wrote:


Save the example classes in a folder and look at the output console in
Flash. You will see:

class5 method1
class2 method1
class2 method1
class1 method1

This doesn't have any sense.

If you override the method in class4, or in class3, like this, it works
fine:

code
Class4 extends Class3 {
   public function method1():Void {
   super.method1();
   }
}
/code
The output in this case is:
class5 method1
class2 method1
class1 method1

But I don't wanna override the method in Class3 nor Class4 to do nothing
but call super, because is not needed in a OOP language.

Hans Wichman escribió:
 Hi,
 not 3 times? I don't think its being called twice in class2, class5's
 superclass is class 4, which doesnt not redefine class2's method.
 Let class 5 extend class2 for testing purposes, it probably will work
 correctly and introduce class3 to see what it does. Then override
 method1 in
 class 3 to see what it does.

 greetz
 JC


 On 9/28/06, Miguel Angel Sánchez [EMAIL PROTECTED] wrote:

 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

 :-/
 ___
 Flashcoders@chattyfig.figleaf.com
 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

 ___
 Flashcoders@chattyfig.figleaf.com
 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

___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] Inheritance bug in AS2 Flash 8

2006-09-28 Thread slangeberg

Sounds like the inheritance chain

Theoretically, seems like when Class 3  4 don't implement the method, the
line of execution goes up the chain until it is: Class 2.

Scott

On 9/28/06, Miguel Angel Sánchez [EMAIL PROTECTED] wrote:


Save the example classes in a folder and look at the output console in
Flash. You will see:

class5 method1
class2 method1
class2 method1
class1 method1

This doesn't have any sense.

If you override the method in class4, or in class3, like this, it works
fine:

code
Class4 extends Class3 {
public function method1():Void {
super.method1();
}
}
/code
The output in this case is:
class5 method1
class2 method1
class1 method1

But I don't wanna override the method in Class3 nor Class4 to do nothing
but call super, because is not needed in a OOP language.

Hans Wichman escribió:
 Hi,
 not 3 times? I don't think its being called twice in class2, class5's
 superclass is class 4, which doesnt not redefine class2's method.
 Let class 5 extend class2 for testing purposes, it probably will work
 correctly and introduce class3 to see what it does. Then override
 method1 in
 class 3 to see what it does.

 greetz
 JC


 On 9/28/06, Miguel Angel Sánchez [EMAIL PROTECTED] wrote:

 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

 :-/
 ___
 Flashcoders@chattyfig.figleaf.com
 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

 ___
 Flashcoders@chattyfig.figleaf.com
 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

___
Flashcoders@chattyfig.figleaf.com
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





--

: : ) Scott
___
Flashcoders@chattyfig.figleaf.com
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