member variables of a class has been changed, in each loop

I ’ve declared some classes in my cocos2dx program, and I ’ve set some values for their member variables, but after each time the program loops ( the main loop of the CCDirector ), all of their values have been removed!
I want it class to save its next scene that should be replaced or pushed when the scene should be replaced and I ’ve set a variable named nextScene for the next Scene, but after each loop, its value changes into NULL.
plz help me with this problem, and also is there some better ways to handling the scenes and changes of them??
tnx a lot!

StartingPage is a class which is inherited from CCLayerColor.
Here is CoCoGui.h file:

#ifndef COCOGUI_H
#define COCOGUI_H
#include “StartingPage.h”
#include “WorkSpace.h”
#include “GameBoard.h”
#include “IntroPage.h”
using namespace cocos2d;
class CoCoGui : public CCLayerColor{
public:
CoCoGui();
void addScene (CCScene * startPage, CCScene * work);
virtual ~CoCoGui(void);
void updateGame ( float dt );
virtual bool init();
static CCScene* scene();
void Done ( );
CREATE_FUNC(CoCoGui);
private:
bool isInit;
CCScene * runnigScene;
IntroPage * introPage;
WorkSpace * workSpace;
StartingPage * startingPage;
void onEnterTransitionDidFinish();
void menuCloseCallback(CCObject* pSender);
public:
CCScene * getRunningScene(void);
};
#endif /* COCOGUI_H /
And this is
CoCoGui.cpp* file:

#include “CoCoGui.h”
#include
using namespace std;
int step = 0;
CCScene* CoCoGui::scene(){
CCScene scene = CCScene::create;
CoCoGui
layer = CoCoGui::create();
scene~~>addChild;
return scene;
}
CoCoGui::CoCoGui
{
this~~>isInit = false;
this~~>startingPage = new StartingPage ;
this~~>introPage = new IntroPage ( );
//this~~>workSpace = new WorkSpace ;
}
CoCoGui::CoCoGui
\ {
\ delete\ introPage;
\ delete\ startingPage;
\ //delete\ workSpace;
\ }
\ void\ CoCoGui::menuCloseCallback
\ {
\ CCDirector::sharedDirector~~>end;
\ #if\
\ exit;
\ #endif
\ }
\ bool\ CoCoGui::init\ {
\ if\ )\ ){
\ return\ false;
\ }
\ this~~>schedule\ );
\ return\ true;
\ }
\ void\ CoCoGui::Done\ {
\ }
\ void\ CoCoGui::updateGame\ {
\ if\ )
\ return;
\ cout\ <<\ “called”\ <<\ endl;
\ }
\ void\ CoCoGui::onEnterTransitionDidFinish\ {
\ this~~>introPage~~>setNextScene\ );
\ CCScene\ *\ scene\ =\ NULL;
\ scene\ =\ IntroPage::scene;
\ CCTransitionFade\ *\ trans\ =\ CCTransitionFade::create;
\ CCDirector::sharedDirector~~>pushScene;
\ step\ =\ 1;
\ cout\ <<\ “step”\ <<\ endl;
\ }
\ CCScene\ *\ CoCoGui::getRunningScene
\ {
\ return\ this~~>runnigScene;
\ }
This\ is\ introPage.h\ file:
\ #ifndef\ INTROPAGE_H_
\ #define\ INTROPAGE_H_
\ #include\ “cocos2d.h”
\ #include\ “StartingPage.h”
\ using\ namespace\ cocos2d;
\ class\ IntroPage:\ public\ CCLayerColor\ {
\ public:
\ IntroPage;
\ IntroPage\ ;
\ virtual
IntroPage;
static CCScene* scene;
bool init;
void intoPageDone;
CREATE_FUNC;
CC_SYNTHESIZE_READONLY;
void menuCloseCallback;
CCScene * setNextScene;
bool isIntroPageDone ;
void setNextScene ;
private:
bool introPageDone;
CCScene * nextScene;
CCSprite introLogo_1;
CCSprite
introLogo_2;
};
#endif /* INTROPAGE_H_ /
And also
IntroPage.cpp**:
#include “IntroPage.h”
bool IsIntroPageDone = false;
IntroPage::IntroPage {
this~~>introPageDone = false;
this~~>setNextScene ;
}
IntroPage::IntroPage( ){ nextScene = nextScene; }
IntroPage::~IntroPage() { // TODO Auto-generated destructor stub }
void IntroPage::setNextScene ( CCScene * nScene ){ this->nextScene = nScene; }
CCScene* IntroPage::scene(){ CCScene *scene = CCScene::create(); IntroPage *layer = IntroPage::create(); scene->addChild(layer); return scene; }
bool IntroPage::init {
if )) {
CCSize winSize = CCDirector::sharedDirector~~>getWinSize;
introLogo_2 = CCSprite::spriteWithFile);
introLogo_2~~>setPosition);
this~~>addChild;
introLogo_1 = CCSprite::spriteWithFile);
introLogo_1~~>setPosition);
this~~>addChild;
this~~>*label = CCLabelTTF::labelWithString;
*label~~>retain;
_label~~>setColor);
_label~~>setPosition);
this~~>addChild;
/*introLogo_1~~>runAction);
introLogo_2~~>runAction);**/
//_label~~>runAction(CCFadeIn::create(1.5));
this->runAction( CCSequence::actions(CCDelayTime::actionWithDuration(2), CCCallFunc::actionWithTarget(this, callfunc_selector(IntroPage::intoPageDone)), NULL));
//introLogo~~>runAction);
return true;
}
return false;
}
void IntroPage::intoPageDone {
this~~>introPageDone = true;
CCDirector::sharedDirector( )->popScene( );
CCDirector::sharedDirector( )->pushScene( this->nextScene );
}
void IntroPage::menuCloseCallback(CCObject* pSender)
{
CCDirector::sharedDirector()>end;
#if
exit;
#endif
}
bool IntroPage::isIntroPageDone {
return this
>introPageDone;
}