延时还是没有搞定

要实现fun1运行后等待1秒后执行fun2,我下面这样写的失败了。

或者换个思路,就是fun1运行后,等待1秒,然后执行fun2。

麻烦麻烦!

var UI= {
main : function () {
UI.fun1();
this.runAction(cc.Sequence.create(cc.DelayTime.create(1), UI.fun2());
},
fun1: function () {
var sprite1 = cc.Sprite.create(“1-1.png”);
sprite1.x = cc.winSize.width/2 - 54;
sprite1.y = cc.winSize.height/2 + 54;
cc.director.getRunningScene().addChild(sprite1);
},
fun2: function () {
var sprite2 = cc.Sprite.create(“1-2.png”);
sprite2.x = cc.winSize.width/2 + 54;
sprite2.y = cc.winSize.height/2 - 54;
cc.director.getRunningScene().addChild(sprite2);
}
}

this.runAction(cc.Sequence.create(cc.DelayTime.create(1), UI.fun2());

函数名后面不要带“()”,如下:

this.runAction(cc.Sequence.create(cc.DelayTime.create(1), UI.fun2);
或者为了使用当前域可以如下:
this.runAction(cc.Sequence.create(cc.DelayTime.create(1), UI.fun2.bind(this));

还是不行…
UI.fun1();
this.runAction(cc.Sequence.create(cc.DelayTime.create(1), UI.fun2()));
结果是2个都显示出来。
UI.fun1();
this.runAction(cc.Sequence.create(cc.DelayTime.create(1), UI.fun2));
是只显示fun1,fun2死活不显示出来。

另外,
//UI.fun1();
this.runAction(UI.fun1, cc.Sequence.create(cc.DelayTime.create(1), UI.fun2));
这样2个都显示不出来。

    //UI.fun1();
    this.runAction(UI.fun1, cc.Sequence.create(cc.DelayTime.create(1), UI.fun2));

这样2个都显示出来!!!

疯了。UI.fun2.bind(this)也是一样的。