- 注册时间
- 2014-3-20
- 最后登录
- 2016-5-22
- 阅读权限
- 20
- 积分
- 98
- 精华
- 0
- 帖子
- 22
|
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。 |
|