2,278
社区成员




btn1.onRelease = function() {
fscommand("btn1", "");
}
btn2.onRelease = function() {
fscommand("btn2", "");
}
...(可能有100个这样的函数,一个一个写会累死的)
#define BTN_RELEASE(n) \
btn##n.onRelease = function() { \
fscommand("btn"+#n, ""); \ // 当然这里类型需要转换一下(两个字符串不能相加),只是表达意思,不那么严谨
}