lufy's legend

标题: 子对象的点击事件bug [打印本页]

作者: matthew    时间: 2015-2-1 10:01
标题: 子对象的点击事件bug
                      LInit(20, "gamediv", 800, 480, main);
                        function main () {
                                LGlobal.setDebug(true);
                                var car = new LSprite();
                                car.x = car.y = 20;
                                var carshape = new LSprite();
                                carshape.graphics.drawRect(2, "#ff0000", [10, 10, 50, 100], true, "#880088");
                                car.mouseEnabled=false;
                                car.mouseChildren = true;
                                addChild(car);
                                car.addChild(carshape);
                               
                                carshape.addEventListener(LMouseEvent.MOUSE_DOWN,function(e){
                                        trace("car shape clicked");
                                });
                        }
-------------------------------------------
car.mouseEnabled=false;
car.mouseChildren = true;
这样设置后 子sprite “carshape” 点击无效

mouseEnabled
显示列表上的该实例的任何子级都不会受到影响。要更改显示列表上对象的所有子级的 mouseEnabled 行为,请使用 LDisplayObjectContainer.mouseChildren。
作者: lufy    时间: 2015-2-1 10:15
多谢提供bug报告
下个版本修正此问题




欢迎光临 lufy's legend (http://lufylegend.com/forum/) Powered by Discuz! X2.5