I have a number of different buttons which I have called
red, blue and green (instance name)
I want a piece of code that recognises which of the button red, blue, yellow and green has been chosen. Please note these are buttons and not radiobuttons.
Printable View
I have a number of different buttons which I have called
red, blue and green (instance name)
I want a piece of code that recognises which of the button red, blue, yellow and green has been chosen. Please note these are buttons and not radiobuttons.
Is this what your looking for?
Code:red.onRelease = function () {
getCol (this._name);
};
blue.onRelease = function () {
getCol (this._name);
};
yellow.onRelease = function () {
getCol (this._name);
};
function getCol (butName) {
switch (butName) {
case "red" :
trace ("red pressed");
break;
case "blue" :
trace ("blue pressed");
break;
case "yellow" :
trace ("yellow pressed");
break;
}
}