start_button.js-2014-04-21

来源:互联网 发布:淘宝直通车费用 编辑:程序博客网 时间:2024/05/29 16:08
<script>
    function dot_Sprite(){
        //var a = 5;
        //alert("dot_Sprite");
        this.create = function(){
            alert("dot_Sprite.create()");
        }
    }
    function dot_Button(){
        this.start = function(){
            alert("dot_Button.start()");
        }
    
    }
    function test(){
        alert("test");
    }
    var sprite = new dot_Sprite();
    sprite.create();
    var button = new dot_Button();
    button.start();
    alert("dot_button.prototype.constructor------"+dot_Button.prototype.constructor);
    dot_Button.prototype.constructor = test;
    alert("dot_button.prototype.constructor------"+dot_Button.prototype.constructor);
    dot_Button.prototype = new dot_Sprite;
    alert("1--"+dot_Button.prototype.constructor);
    dot_Button.prototype.constructor = test;
    alert("2--"+dot_Button.prototype.constructor);
    //dot_Button.prototype.constructor =
    alert("dot_button.prototype------"+dot_Button.prototype);
    var button111 = new dot_Button();
    button111.create();
    
     //dot_Button.prototype = new dot_Sprite;
</script>
0 0