PDA

View Full Version : One Class to rule them all...



ofeet
May 26th, 2008, 12:17 PM
Here's my question: let's say I have 200+ movie clips laid out on the stage (before run-time). I also have a Class called "Country" that I want all of my 200+ movie clips to inherit from. Unfortunately I can't link my Country class to the 200+ countries in the library because all linkage identifiers need unique names.

in AS2 I can set the linkage for all 200+ country clips to pull from my Country class. What's the equivalent of this in AS3?? Keep in mind I already have all my 200+ countries out on the stage, so passing them as a parameter into the Country constructor is not an option.

Any help is much appreciated!!

Pier25
May 26th, 2008, 01:56 PM
and in the darkness bind them...

Why can't you pass the name of the movieclip as a parameter?

You can have a sequential code on each movieclip, an array with the same codes, and then your class which would create as many instances of that class as there are elements in the array. Then you can still apply any listeners, or transformations to a particular movieclip, tied to an instance of your class using the code on the array.

I'm really new to AS3 but I think that should work...

sasxa
May 26th, 2008, 01:57 PM
is Linkage...>Base Class what you looking for?

ofeet
May 26th, 2008, 03:29 PM
is Linkage...>Base Class what you looking for?

Okay I am an idiot... for some reason I was under the crazy impression that you couldn't modify the base class. I swear I've tried it before and it didn't work. Anyway I tried it just now and it works fine. Thanks for the help!!