problems description: see notation
@
control:function(){
for(var i=0;i<5;i++){
this.buttons[i].setIsEnabled(false); //menuitem disabled as we hoped.
}
// setTimeout(this.enableControlButton,3000); if use this line, Error, chrome:Uncaught TypeError: Cannot read property ‘0’ of undefined
// setTimeout(this.enableControlButton(),3000); if use this line instead of the above one, function enableControlButton will run immediately, won’t wait for 3s. menu item enabled.
},
enableControlButton:function(){
for(var j=0;j<5;j++){
this.buttons[j].setIsEnabled(true);
}
}
@
Aything thing wrong? why can’t i get the right results.
Thanks, in this case what should i do to use CallFunc or DelayTime? I’ve only seen examples useing these two functions with sprite actions. how to use them alone? I would love to use these two instead of setTimeout to stay purely cocs2d. Appreciate