This content has been marked as final. Show 11 replies
You said it, just use the import keyword at the top of your class. However in AS2.0 you can only extend one class from another at a time. You extend using the ‘extend’ keyword on the same line as the ‘class’ keyword is used, eg;
class Peacock extends MovieClip
…//rest of class not shown
But extending is different then importing, extending is a form of inheritance which may be out of scope of your question.
Never mind. All it takes is posting and then you read the help files closer. For anybody who comes by…
You place the import statements before the class definition.
Thanks myIP our posts crossed.
what's the Peacock class do?
It makes a fan of peacock feathers. It is mostly just an excuse to practice my AS2. (David "Seething Cauldron" Still has lured me to the dark side!) I've got the strut() and modesty() methods down. I'm closing in on shimmy(). But there are two bits I haven't really worked out yet, neither really has to do with AS 2.
Any good approach for having slight variations in color? I'm using the drawing API to draw the spots/eyes and want to have each one vary a bit in color. Any good approaches or places I should check out?
The other is that crazy modulo math. I need to generate the following sequence:
-1, 1, -2, 2, -3, 3, -4, etc.
and or alternately:
0, 1, 1, 0, 0, 1, 1, 0, 0, repeating
I've got a nasty hacky bit, but I'm sure there is an elegant way, but my mind just doesn't go that way.
When I get it polished up a bit more I would be happy to post a copy if you want to see it.
sure, i'd like to see a peacock shimmy and strut.
here's a function that takes the positive integers and returns your sequence:
Thanks LuigiL I don't have Flash 8 so I can't use the matrix class. But I think I can work it out. Or maybe I should just dive in and get Flash 8!
Thanks kglad. For some reason my brain just fries every time I have to do modulo math. I generally get calculus, trig, and so on, but something so simple is just beyond me. Go figure. :)
Well, what you can do with all the new classes in Flash 8... I think you will very much appreciate 8!