var rand = Math.random();
num = Math.floor(rand * this.range);
let children = this.node.children;
let judge = cc.find("Canvas/judge");
cc.log("cardgroup:",children.length);
cc.log("random card id:",num);
children[num].active = true;//???????
// children[num].x = -400;
cc.log(children[num].name);
let finished = cc.callFunc(function (target){
let bt_node = children[num];
bt_node.parent = judge;
bt_node.x = 0;
this.range -= 1;
cc.log("range:",this.range);
let msgForDispatchEvent = new cc.Event.EventCustom("card", true);
msgForDispatchEvent.detail = bt_node.cardid;
bt_node.dispatchEvent(msgForDispatchEvent);
cc.log(bt_node.parent.name);
}, this, 100);
let action = cc.sequence(cc.moveTo(0.5, 400, 0), cc.scaleTo(1.25,1.25), cc.scaleTo(1,1), finished);
children[num].runAction(action);