Event trapping/capturing

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)


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.

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

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. :confused: