I’m making a function to be called by different buttons, and I want the function also alter the appearance of the button itself. But I don’t know how to refer to the button from within the generic function.
function set_style() {
trace('this: '+this);
trace('_parent: '+_parent);
trace('_root: '+_root);
trace('_level0: '+_level0);
//none of these produce the name of the button
}
bt1.onRelease = function() {
set_style();
trace('[from button] this: '+this);
//this produces the name of the button
};
function set_style(mc) {
mc = this;
trace('this: '+this);
trace('_parent: '+_parent);
trace('_root: '+_root);
trace('_level0: '+_level0);
//none of these produce the name of the button
}
bt1.onRelease = function() {
set_style(this);
trace('[from button] this: '+this);
//this produces the name of the button
};