# Event trapping/capturing

**URL:** <https://forum.kirupa.com/t/event-trapping-capturing/264618>\
**Category:** flash\
**Created:** [June 27, 2008, 7:46pm UTC](https://forum.kirupa.com/t/event-trapping-capturing/264618 "2008-06-27T19:46:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)\
**Post date:** [June 27, 2008, 7:46pm UTC](https://forum.kirupa.com/t/event-trapping-capturing/264618/1 "2008-06-27T19:46:20Z")

</div>

I’m not quite sure what I’m doing wrong here, but here’s a quick pseudocode example;

(inside a class called hNavStage that extends Sprite. Custom class navException also extends Sprite)

```auto

var mN:navException = new navException();
mN.addEventListener(Event.ENTER_FRAME,drawBlur);

priv function drawBlur(e:Event):void {
  trace(e.target);
};

```

This traces out (for every tic)

[object hNavStage]  
[object navException]

Now, I realize that this is because of how the event travels but I’m really only interested in the navException inside that enter\_frame callback… so e.target is out. doing e.stopPropagation() didn’t do me much good, and I barely understand the usecapture boolean in the event declaration.

Anyone got an idea how I can focus the enter\_frame to just the second class? ie m/navException?

Thanks guy.

---

<div class="post-metadata">

**Author:** ![Felixz](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@Felixz](https://forum.kirupa.com/u/Felixz)\
**Post date:** [June 27, 2008, 8:51pm UTC](https://forum.kirupa.com/t/event-trapping-capturing/264618/2 "2008-06-27T20:51:14Z")

</div>

U propably have two listeners added Event.ENTER\_FRAME is normal event dispatched directly (no propagation, bubbling property set to false)

---

<div class="post-metadata">

**Author:** ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)\
**Post date:** [June 27, 2008, 8:56pm UTC](https://forum.kirupa.com/t/event-trapping-capturing/264618/3 "2008-06-27T20:56:02Z")

</div>

I don’t actually… it’s just one. I thought the same thing first, but no.

The setup is as;

doc class;

- makes a new hNavStage instance)
- addchilds it

hNavStage class;

- makes a new navException instance
- addchilds it

and then the code above. Traces out both. 😕
