Is it possible to dynamically determine what methods an MC is using?

I want to be able to ask a MC what methods it is currently using. Is there some sort of Flash method that returns a list existing methods of an MC?

Here's the deal I want to be able to check the methods of an MC that has various button methods added to it in AS.

I want to be able to save those methods as vars or objects, delete them for a time, then add them back. Sort of like this:

//get the _parent button method onRelease and enabled state then delete the onRelease method:

this[this._name+"_startAudio"].parentFunc = this._parent.onRelease;
this[this._name+"_startAudio"].parentEnabled = this._parent.enabled;
this[this._name+"_startAudio"].parent = this._parent;
delete this._parent.onRelease;

//when the child button is released, add the method back to the parent and set the enabled state to the previous state
this[this._name+"_startAudio"].onRelease = function(){
      this.enabled = false;
      //this._visible = false;
      this.parent.onRelease = this.parentFunc;
      this.parent.enabled = this.parentEnabled;
      trace(this.parent);
      removeMovieClip(this);
      playAudio("S");
}
This is working in my code, but I want to be able to cycle through all the "button" methods in an MC and save and delete then add them back later. I realize I could just create an array of all the possible "button" methods and then cycle through that way, but is there another way?

Thanks in advance!
acekzAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MontoyaProcess Improvement MgrCommented:
Well, you could do that by using addproperty or prototyping the mc.

The basic logic is that you will create the properties for the movie clip. Then, you will assign values to those properties when you cal the method/function/whatever...

Finally, you can trace the property of the mc to see its value.

Make sense?

acekzAuthor Commented:
I don't want to add properties to the MC, I just want to retrieve any methods that have been added to it...I may not have control over putting properties into it. I need to be able to detect if these methods exist without having created the clip myself so I wouldn't really know what methods to look for...I think i'll just create an array of "button" methods...
nifmcmCommented:
for (var i in mc) {
    if (typeof(mc[i]) == "function") {
        //save method to variable.
    }
}

out of interest, what is your reason for wanting to delete methods? would a simple mc.enabled = false not do?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.