from: Developing Android Applications with Adobe AIR
function onEnterFrame(event:Event):void {
event.stopPropagation();ball.x -= vx;
ball.y += vy;
}
Notice the event.stopPropagation method called in the onUpdate function. It is important
to eliminate unnecessary steps, especially if you have a deep displayList.
The event flow sends an event throughout the display list, from the top,
looking for event listeners that may have been defined along the way
and then bubbled back up. StopPropagation() stops the process as soon
as the event finds the target.
本文探讨了在使用Adobe AIR开发Android应用时如何有效地处理onEnterFrame事件,以优化性能并避免不必要的步骤。重点介绍了事件传播过程及其停止方法,确保在具有复杂显示列表的应用中实现高效渲染。
686

被折叠的 条评论
为什么被折叠?



