闪光事件阶段? [英] Flash Event Phases?

查看:169
本文介绍了闪光事件阶段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能有人简单地说明3个阶段在Flash事件框架,好吗?

通过事件阶段,我的意思是:

  • CAPTURING_PHASE
  • AT_TARGET
  • BUBBLING_PHASE

要清楚,我说的是对象类型:flash.events.Event 和子类。

这是深入的例子是的梦幻般的的。当你点击会发生什么嵌套影片剪辑

解决方案
  

使用您处理一个事件的三个​​阶段事件传播(见图2)。每个阶段重新presents路径或一个事件的位置,因为它的工作原理本身通过​​涉及该事件在Flash中的显示对象。这三个阶段的事件被捕获,在目标和冒泡:

  • 捕获阶段:此重新presents的 目标对象的父对象 从该事件的起源。任何 具有所传播的事件开始 最顶层的父(阶段)和工程 下显示对象的层次结构 直到达到原来的目标。

  • 在目标阶段:目标相 该事件是在所述相 目标对象或从对象 该事件起源。不比 捕获和冒泡阶段, 这个阶段总是只涉及 一个对象,目标对象

  • 冒泡阶段:当一个事件 泡沫也沿用了相反的 捕获阶段的路径和 它的工作方式备份父 目标对象的层次结构,直到 到达最上面的父母或 阶段。

公然被盗:介绍事件处理在ActionScript 3.0

Could someone simply explain the 3 phases in the Flash Event framework, please?

By event phases, I mean:

  • CAPTURING_PHASE
  • AT_TARGET
  • BUBBLING_PHASE

To be clear, I'm talking about flash.events.Event and subclasses.

An in-depth example would be fantastic. What happens when you click on a nested MovieClip?

解决方案

With event propagation you're dealing with three "phases" of an event (see Figure 2). Each phase represents a path or the location of an event as it works itself through the display objects in Flash that relate to that event. The three phases of an event are capturing, at target, and bubbling:

  • Capturing phase: This represents the parent objects of the target object from which the event originated. Any propagated event starts with the topmost parent (stage) and works down the display object hierarchy until reaching the original target.

  • At target phase: The target phase is the phase where the event is at the target object or the object from which the event originated. Unlike the capturing and bubbling phases, this phase always relates to only one object, the target object.

  • Bubbling phase: When an event "bubbles" it follows the reverse path of the capturing phase and works its way back up the parent hierarchy of the target object until reaching the top-most parent or stage.

Blatantly stolen from: Introduction to event handling in ActionScript 3.0

这篇关于闪光事件阶段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆