eg, if i have an Object that extends Sprite and Implements Mungable i would like to do something like:-
var foo:Sprite <mungable>
so that i can do something like:
addChild(foo);
foo.munge();
Is this possible in Actionscript 3?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not directly. As others suggested, you can create a type, say
MungableSprite, that extendsSpriteand implementsMungableand then refer to that type. However you will only be able to use this for objects, who’s type is a subtype ofMungableSprite.But you cannot simply convey the type relationship “an object, which is Mungeable and a Sprite”.