[Resolved]MenuItemImage not responding to touch/click

[Resolved]MenuItemImage not responding to touch/click
0.0 0



I m just starting cocos2d-x html5 so it might be a newbie question.

I just started from HelloHTML5World sample.

I have these scene with two buttons, close button works fine , but play button did not. it is displayed but not responding to click/touch

any ideas why ?

init:function ()
var selfPointer = this;
var size = cc.Director.getInstance().getWinSize();
// add a “close” icon to exit the progress. it’s an autorelease object

var closeItem = cc.MenuItemImage.create(“res/CloseNormal.png”,“res/CloseSelected.png”, function () {cc.log(“close”);alert(“close”);},this);
closeItem.setAnchorPoint(cc.p(0.5, 0.5));
var menu = cc.Menu.create(closeItem);
this.addChild(menu, 1);
closeItem.setPosition(cc.p(size.width - 20, 20));

var playItem = cc.MenuItemImage.create( “res/play_tmp.png” , “res/play_tmp_over.png”,function () {cc.log(“play”);alert(“play”);},this);
playItem.setAnchorPoint(cc.p(0.5, 0.5));
playItem.setPosition(cc.p(size.width * 0.5 , size.height * 0.5 ));

window.addEventListener(“resize”, function (event) {
return true;


i fail to see anything wrong that causes the problem

does the button responds to click/touch visually? (it change to the second image?)


problem sloved, images wasnt declared as resources :slight_smile:


problem sloved, images wasnt declared as resources :slight_smile: