title: Cocos2d-x schedule a call
body: <p>I'm trying to schedule a call for a function, the function is changeScene() and it's never being called</p>
  
  <p>Any idea what am I doing wrong?</p>
  
  <p>Cocos-2d-x 3.0</p>
  
  <pre><code>#include "LoadingScene.h"
  LoadingScene::LoadingScene(){}
  
  LoadingScene::~LoadingScene(){}
  
  bool LoadingScene::init() {
      return Scene::init();
  }
  
  void LoadingScene::onEnter(){
      // add background to current scene
      Sprite *background = Sprite::create("splash.png");
      Size visibleSize = Director::getInstance()-&gt;getVisibleSize();
      Point origin = Director::getInstance()-&gt;getVisibleOrigin();
      background-&gt;setPosition(origin.x + visibleSize.width/2, origin.y + visibleSize.height/2);
      this-&gt;addChild(background);
  
      // start ansyc method load the atlas.png
      Director::getInstance()-&gt;getTextureCache()-&gt;addImageAsync("atlas.png", CC_CALLBACK_1(LoadingScene::loadingCallBack, this));
  }
  
  void LoadingScene::loadingCallBack(Texture2D *texture){
      AtlasLoader::getInstance()-&gt;loadAtlas("atlas.txt", texture);
      this-&gt;scheduleOnce(schedule_selector(LoadingScene::changeScene), 2.0f);
  }
  
  void LoadingScene::changeScene(float dt) {
      auto scene = WelcomeScene::create();
      TransitionScene *transition = TransitionFade::create(1, scene);
      Director::getInstance()-&gt;replaceScene(transition);
  }
  </code></pre>