也可以把代码简化为:
复制内容到剪贴板
代码:
function handlerFunc(_str:String, _p:Number) {
mc1[_str] += _p, mc2[_str] += _p;
}
menu1.onRelease = function() {
handlerFunc("_rotation", 5);
};
menu2.onRelease = function() {
handlerFunc("_rotation", -5);
};
menu3.onRelease = function() {
handlerFunc("_xscale", 5);
handlerFunc("_yscale", 5);
};
menu4.onRelease = function() {
handlerFunc("_xscale", -5);
handlerFunc("_yscale", -5);
};