2 Replies to “Inheritance”

  1. Hi Jesse,

    I feel your pain. I finally figured out that whole hullabaloo about inheritance in Flash as well. As far as I understand it, there is a pretty easy fix for this.

    Place the following line at the start of the constructor that you are inheriting from:

    if(this._name==undefined) return;

    This way the constructor’s init will only fire if it is in a movieclip (and thus needs to be called).

    You can read about it on this flashcoders thread:
    http://chattyfig.figleaf.com/ezmlm/ezmlm-cgi?1:mss:39543:200207:fdpipimlddhaciadhmci

    or at Burch Blog:
    http://radio.weblogs.com/0107886/2002/07/01.html#a11

  2. Rock! That is so much better than the solutions I heard about. Thank you so much!

    I really don’t mind adding that to my super classes at all. Tight solution.

Comments are closed.