doesClassExtend()

Edit: Scrap this post.

Mr Peters just shown me that…

[as]SuperClass.prototype.isPrototypeOf( SubClass.prototype );[/as]

…does the same thing.

Bonus!

7 Responses to “doesClassExtend()”

  1. sakri says:

    I feel dirty when using prototype. It’s like, I have to get off my as3 high horse and descend back to the ranks of as1 and javascript kiddies ;)

  2. Tink says:

    Yeah, bet it’s quicker than my alternative which you can view here

    http://www.tink.ws/blog/files/as3/doesClassExtend.as

  3. sakri says:

    ’twas just a joke… I just remember these ‘apps’ with a zillion MovieClip.prototype functions and I get the heebie jeebies :D Mind you, your solution is pretty 1337, even if it’s slower.

  4. flabbygums says:

    Hi Tink,

    I’m just curious; what’s a real world example where you’d need to test for an object’s inheritance? Or is there a particular design pattern you could point me to that uses this and I’ll look it up?

    Thanks!

    MK

  5. flabbygums says:

    Sorry, i mean a class’ inheritance.

  6. Tink says:

    I wanted to make sure that class specified as the custom preloader class for a flex app (your not able to get an the instance, only the class that was used), extended a base class I had set up, so that runtime styles are loaded as part of the preload/initialize process..

  7. flabbygums says:

    Ahhh….got it.

    Thank you.

Leave a Reply