I’ve created a simple class… in the class I have a function which creates a button clip…
_global.TestClass= function()
{
this.createButton = function()
{
_root.createEmptyMovieClip("button",300);
_root.button.lineStyle(0,0x000000,100);
_root.button.beginFill(0xE6E6DC,100);
_root.button.moveTo(20,35);
_root.button.lineTo(20,55);
_root.button.lineTo(100,55);
_root.button.lineTo(100,35);
_root.button.lineTo(20,35);
_root.button.endFill();
_root.button.onRelease = function()
{
// here's the problem.
PATH-TO-METHOD?.buttonClicked();
}
};
this.buttonClicked = function()
{
trace("Button Clicked");
};
}
In the onRelease handler I call the buttonClicked function within the class… however… I can’t get it to work. Basically, I don’t know how to path reference it. If I say this.buttonClicked() then it is referring to the clip itself instead of the class. Any suggestions? Thanks in advance.