Can any one tell me why this don't work?
function buttonAction(buttonName:MovieClip, buttonMove:String) {
buttnName.gotoAndStop(buttonMove);
}
aboutButton.onRollOver = function() {
buttonAction(aboutButton, over);
};
Thanks
RSB
Printable View
Can any one tell me why this don't work?
function buttonAction(buttonName:MovieClip, buttonMove:String) {
buttnName.gotoAndStop(buttonMove);
}
aboutButton.onRollOver = function() {
buttonAction(aboutButton, over);
};
Thanks
RSB
I believe this should work:
ORPHP Code:function buttonAction(buttonName:MovieClip, buttonMove:String) {
_root[buttonName].gotoAndStop(buttonMove);
}
aboutButton.onRollOver = function() {
buttonAction(aboutButton, over);
};
PHP Code:function buttonAction(buttonName:MovieClip, buttonMove:String) {
buttonName.gotoAndStop(buttonMove); //You forgot the "o" here
}
aboutButton.onRollOver = function() {
buttonAction(aboutButton, over);
};
hi,
unless over is a variable, it should be a string:
code:
aboutButton.onRollOver = function() {
buttonAction(aboutButton, 'over');
};
A equivalent and cleaner way is using this:
code:
aboutButton.onRollOver = function() {
buttonAction(this, 'over');
};
Notice that using _root is not recommended and if you're using array notation, buttonName can't be a MovieClip and should be a String instead.
Thanks for the input.
The problem was a dub one on my part.
I was missing an "o" in the word button, and I needed the string argument being passed to be in quotes.
As for the use of "this" that a good point.
Thanks again
rsb