Only the standard "be really careful what you do when calling methods
in your constructor" issue.

i.e.

class A
{
 function A()
 {
   someFunction();
 }

 function someFunction()
 {
   // do Something
 }
}

class B extends A
{
 function B()
 {
   super();
   // set up some initialisation stuff here... (*)
 }

 function someFunction()
 {
   // This is automatically called by the parent class's constructor...
   // Do something that relies on (*) here - oh, we can't, the
initialisation step hasn't been
   // carried out yet!
 }
}

In AS2 this does work, but clearly can cause a problem. In C++ it's a
whole different kettle of fish if you do this with a virtual function,
as you might (depending on the compiler) end up calling the parent
implementation of someFunction instead of the child function as the
virtual function table hasn't been properly constructed yet... (in
better compilers you get a compile error) but at least you could have
avoided marking someFunction as virtual, and thus got predictable
behaviour (the parent implementation called every time).

In other words - I can't think of any major issues. But as a general
rule, take care calling potentially overridden functions from the
constructor...

Ian

On 7/31/06, Andreas R <[EMAIL PROTECTED]> wrote:
Just reading up on some C++ and realized all functions in an AS2 class
are virtual.. Anyone know if this has any negative implications? :)

Cheers,

- A
_______________________________________________
[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

_______________________________________________
[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