Does cc.Director().getInstance().replaceScene removes the touch functionality after replacing the scene?

Hi , I have two scenes 1.TitleScene 2.MainMenuScene

First I am saying in main.js to load the TitleScene with

var myApp = new cocos2dApp(TitleScene);

In TitleScene I have placed a label when pressed it should go to MainMenuScene, it is fine.

I am going to MainMenuScene and it is displaying label .
After going to MainMenuScene when I pressed the label there the action is
not being performed.

I am giving those two files as attachments ,please give me the solution.


TitleScene.zip (1.6 KB)

guys, setTouchEnabled in your layer in every scene

Yes cc huang,

I have setMouseEnabled(true), but the onMouseDown : function(event) is being called sometimes (first time but not being called from secondtime).

I have used this code to change to another scene.

var scene = MenuLayer.create();
cc.Director.getInstance().replaceScene(cc.TransitionFade.create(0.5, scene));

var MenuLayer = cc.Layer.extend({

…………….
……………

});

MenuLayer.create = function () {
var sg = new MenuLayer();
if (sg && sg.init()) {
return sg;
}
return null;
};

MenuLayer.scene = function () {
var scene = cc.Scene.create();
var layer = MenuLayer.create();
scene.addChild(layer);
return scene;
};

This is being happening when I change number of times from back to forth .

@
var scene = MenuLayer.scene();
cc.Director.getInstance().replaceScene(cc.TransitionFade.create(0.5, scene));
@

maybe your code should be above