Edit: Scrap this post.
Mr Peters just shown me that…
[as]SuperClass.prototype.isPrototypeOf( SubClass.prototype );[/as]
…does the same thing.
Bonus!
Edit: Scrap this post.
Mr Peters just shown me that…
[as]SuperClass.prototype.isPrototypeOf( SubClass.prototype );[/as]
…does the same thing.
Bonus!
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
Yeah, bet it’s quicker than my alternative which you can view here
http://www.tink.ws/blog/files/as3/doesClassExtend.as
’twas just a joke… I just remember these ‘apps’ with a zillion MovieClip.prototype functions and I get the heebie jeebies
Mind you, your solution is pretty 1337, even if it’s slower.
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
Sorry, i mean a class’ inheritance.
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..
Ahhh….got it.
Thank you.