cc.Class({
    extends: cc.Component,

    properties: {
       
    },

    // use this for initialization
    onLoad: function () {
 
    },
    
    
    click: function (event) {
        var self = this;
        var pos = new cc.p(0, 0);
        if(event.target.name === "button1"){
            pos.x = 0;
            pos.y = 200;
        }else if(event.target.name === "button2"){
            pos.x = 0;
            pos.y = -200;
        }
        cc.director.loadScene("scene2",function (pos) {

            var curScene = cc.director.getScene();
            var canvas = curScene._children[0];
            var hw = canvas.getChildByName("HelloWorld");
            hw.setPosition(pos.x, pos.y);

            cc.log(curScene._children.length);
        }.bind(self, pos))
        
    },
    

    // called every frame
    // update: function (dt) {

    // },
});
