码迷,mamicode.com
首页 > 其他好文 > 详细

lufylegend库 LButton

时间:2015-07-27 18:07:47      阅读:132      评论:0      收藏:0      [点我收藏+]

标签:

lufylegend库 LButton

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>lufylegend</title>
    <script type="text/javascript" src="lufylegend-1.7.6.js"></script>
</head>

<body>
    <div id="mylegend">loading...</div>
    <script type="text/javascript">
    init(50, mylegend, 500, 350, main);
    var loader, bitmapup, bitmapover, field;

    function main() {
        loader = new LLoader();
        loader.addEventListener(LEvent.COMPLETE,loadUp);
        loader.load(up.png,bitmapData);
    }
    function loadUp(event){
        bitmapup = new LBitmap(new LBitmapData(loader.content));
        loader = new LLoader();
        loader.addEventListener(LEvent.COMPLETE,loadOver);
        loader.load(over.png,bitmapData);
    }
    function loadOver () {
        bitmapover = new LBitmap(new LBitmapData(loader.content));
        var layer = new LSprite();
        addChild(layer);
        field = new LTextField();
        field.text=Wait Click;
        layer.addChild(field);
        var testButton = new LButton(bitmapup,bitmapover);
        testButton.y = 50;
        layer.addChild(testButton);
        testButton.addEventListener(LMouseEvent.MOUSE_DOWN,downshow);
    }
    function downshow (event) {
        field.text = testButton Click !;
    }
    </script>
</body>

</html>

 

lufylegend库 LButton

标签:

原文地址:http://www.cnblogs.com/stono/p/4680533.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!