This content has been marked as final. Show 3 replies
movieclips have a _name property AFTER they're instantiated.
and when you create your movie clip, (assuming you don't just build it at authoring time) you specify an instance id through the createEmptyMovieClip function....
taking a cue from this, I'm guessing that my answer is to change the structure of what I'm doing a little... instantiate my object with an instance name as a parameter given to the Class Constructor... that way the class can have it's own name on file.
I guess my only concern there is how do I keep the "name" variable from being just completely arbitrary...?
I guess I'm getting away from application (becaust I don't know when I'd do this...) and into theory.... but for instance, let's say I create my class like this:
var instanceReference:mySuperCoolClass = new mySuperCoolClass("instanceName");
So. I have my class instance... ideally, the class would exist on the stage as "instanceName", with "instanceReference" being another way to reference the instance. That would be ideal... but how do I make that happen? Because in the scenario of what I've just done, I see the class instance existing on the stage as "instanceReference", and I've just passed it a fun, but meaningless bit of data called "instanceName"...
I suppose I could have the class go back to "_parent" and create it's own object.... but here again I'm getting into territory that feels a lot like i have no idea what I'm doing... haha!
I guess I have enough info to get back to coding for now... But I'm deffinately open to more tips... I feel like I'm still missing how a lot of this works.
(I'm at that awkward place where I can easily explain what OOP is, but I'm far from experienced in how to implement it... I've only written about half a dozen classes so far... so I still have a lot to learn. Thanks for your patience, all of you!)
...another thought... maybe what I need to do is make my class an extension of the MovieClip class...?