|
-
I've been fascinated by my study of OO programming in Flash. I'm *beginning* to get it.
Here's one connection I haven't been able to make.
Let's say I created a MC (called MyMC). Using the OLD way, if I wanted to toggle the animation of this MC on or off, I would do something like (from a holderMC),
If (IsSpinning) {
this.MyMC.gotoandstop("lblStop");
} else {
this.MyMC.gotoandplay("lblAnimate");
}
(I may not have the syntax exactly right, but that's not what I'm after right now.)
I don't want to have to put that code in each holder MC. Instead, I want to build a custom method into MyMC (The class, not the instance). So, in the holder MC, I could call the method to toggle animation:
this.MyMC.ToggleAnimation
And, the method inside MyMC would run code similar to the If statement above, and toggle itself.
Is this possible, and if so, how do I do it?
Nothing I have read, so far, about custom methods and prototypes explains how to do it to an existing MC, only on how to do it when building a custom object.
I'm sure there is a simple connection, but I just can't find it.
Thanks in advance for your help. (This is a GREAT resource!)
-Keith
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|