- 注册时间
- 2017-5-23
- 最后登录
- 2017-6-6
- 阅读权限
- 20
- 积分
- 29
- 精华
- 0
- 帖子
- 5
|
lufy 发表于 2017-5-31 08:52
都可以啊,跟普通的LSprite等对象用法一样,你需要先加载才能触发事件
所说的加载就是addChild()吗?还是不太理解,因为我已经可以触发LAnimationTimeline的COMPLETE事件了
部分代码如下:
var playerRight = new LAnimationTimeline(datas, [listChild]);
playerRight.onframe(); //虽然LAnimationTimeline本身不需要onframe()启动,但还是试试它能不能触发ENTER_FRAME事件
playerRight.addEventListener(LEvent.ENTER_FRAME, onFrame); // 经测试,改为COMPLETE事件则可以触发
addChild(playerRight);
function onFrame() {console.log(123)}; |
|