This content has been marked as final. Show 11 replies
what makes you say you can only define 1 movieClip per class? that's incorrect.
Yes since if you do a circle symbol
You need to attach this symbol to a defined class named circle
Npow if you make an oval symbol
You need to attach the symbol to a defined class named circle
Uh oh doesn`t work
This s basicly because you do something like:
MovieClip Foo1 = new Circle()
Instead of the AS2.0 Foo1.attachMovieClip("NameOfClip", depth)
So now flash demand 1 class per movieclip
So Im askng how you can create those atrun time
(your as2 code is incorrect.) but if you want to create multiple instances of a particular class you can use:
I said MOVIECLIP not INSTANCES......
So your code does create many INSTANCES but not more than 1 MOVIECLIP
does Circle() extend movieclip? if yes, then that code creates more than 1 movieclip.
do you mean you want to create instances of multiple classes?
I have a symbol named Circle of type MovieClip that uses the class Circle
I WANT a symbol named Oval to use a class named Oval that is EXACTLY like the class Circle
I DONT WANT to create a new .as file to create that new class but instead copy paste that class at RUN-TIME
1. you can't create a new class during run-time.
2. what's the purpose in creating two classes that are exactly the same except for their name?
If you create 2 estheticly different movieclip that have the same definitions
Like many ennemies in an RPG
Different web buttons
1 class is all you need
Now the only other solution is frame control
create your basic enemy class. then create your specific enemy classes (and specific enemies) that will extend the basic enemy class.
Yea thats what I willdo but I thought there would be better
the only other option i can think of, which isn't desirable from an oop standpoint is to create an enemy class and pass a parameter to the constructor, for example, that then creates the graphic appearance of the instance (and which can vary from enemy type to enemy type) but otherwise shares everything else in common with all other enemy instances.