Re: [Flashcoders] AS3 MouseEvent target?

2008-04-02 Thread Meinte van't Kruis
: [Flashcoders] AS3 MouseEvent target? Extending DisplayObject to access some of its native functionality (e.g. event bubbling) seems fine to me, especially if you look at it from the perspective of EventDispatcher has events and DisplayObject extends EventDispatcher and adds bubbling

Re: [Flashcoders] AS3 MouseEvent target?

2008-04-02 Thread EECOLOR
which is mouseChildren = false. In my humble opinion I do not think this is what he needs. He should not be referencing target, but instead he should reference currentTarget. If you are adding a listener, the handlers e.currentTarget will point to the object that you added the listener to,

Re: [Flashcoders] AS3 MouseEvent target?

2008-04-02 Thread EECOLOR
This behaviour can not emulated precisely because there is no way for us to set the target and currentTarget properties. This is done by internal EventDispatcher code. The EventDispatcher code works something like this: - check if the target property of the event has been set, if not set it -

Re: [Flashcoders] AS3 MouseEvent target?

2008-04-02 Thread Muzak
@chattyfig.figleaf.com Sent: Wednesday, April 02, 2008 2:22 PM Subject: Re: [Flashcoders] AS3 MouseEvent target? which is mouseChildren = false. In my humble opinion I do not think this is what he needs. He should not be referencing target, but instead he should reference currentTarget. If you

Re: [Flashcoders] AS3 MouseEvent target?

2008-04-01 Thread Allandt Bik-Elliott (Receptacle)
ah yes - i couldn't get the mouseChildren to work before when i had drawn in the movieclip but now i've separated the container movieclip from the drawn-in shape, it' s working thanks for your help guys here's a copy of my code in case anyone else is interested: CODE // on

Re: [Flashcoders] AS3 MouseEvent target?

2008-04-01 Thread Allandt Bik-Elliott (Receptacle)
thanks Jiri i've just got the design patterns book so i'll be digging into that at some point in the near future a On 1 Apr 2008, at 10:40, Jiri Heitlager wrote: I think the best way to learn about Event Bubbling is understanding the Composite desing pattern. This is the pattern the

Re: [Flashcoders] AS3 MouseEvent target?

2008-04-01 Thread Jiri Heitlager
I think the best way to learn about Event Bubbling is understanding the Composite desing pattern. This is the pattern the DisplayList is implementing and bubbling will make much more sense when you understand the workings of the Composite Pattern. At least it did for me. Jiri Steven Sacks

Re: [Flashcoders] AS3 MouseEvent target?

2008-04-01 Thread Meinte van't Kruis
the problem with most explanations about event bubbling is that it concentrates on the displaylist (understandable), i'd like to see an example of custom events being bubbled. Though Steven's probably right, playing with it helps alot. On Tue, Apr 1, 2008 at 12:49 PM, Allandt Bik-Elliott

RE: [Flashcoders] AS3 MouseEvent target?

2008-04-01 Thread Merrill, Jason
the problem with most explanations about event bubbling is that it concentrates on the displaylist (understandable), i'd like to see an example of custom events being bubbled. I think that's because only display objects can bubble events, I don't think non-visual classes can bubble events

RE: [Flashcoders] AS3 MouseEvent target?

2008-04-01 Thread Merrill, Jason
I don't necessary see extending DisplayObject as a hack. It's creative leveraging of AS3's native architecture. Extending a display object to get the event bubbling of for a non-visual class - if not a hack, then it's certainly kludgy. Jason Merrill Bank of America GTO and Risk LLD

Re: [Flashcoders] AS3 MouseEvent target?

2008-04-01 Thread Steven Sacks
Extending DisplayObject to access some of its native functionality (e.g. event bubbling) seems fine to me, especially if you look at it from the perspective of EventDispatcher has events and DisplayObject extends EventDispatcher and adds bubbling functionality. If you need bubbling, extend

RE: [Flashcoders] AS3 MouseEvent target?

2008-04-01 Thread Merrill, Jason
, April 01, 2008 3:05 PM To: Flash Coders List Subject: Re: [Flashcoders] AS3 MouseEvent target? Extending DisplayObject to access some of its native functionality (e.g. event bubbling) seems fine to me, especially if you look at it from the perspective of EventDispatcher has events

[Flashcoders] AS3 MouseEvent target?

2008-03-31 Thread Allandt Bik-Elliott (Receptacle)
hi guys in actionscript 3, if i put a mouse event on a movieclip object containing a textfield, should the mouse event be on the movieclip or the textfield? here's my code (comments added to see where the problem is occurring) CODE private function createPeriodBar(dateStart:int,

[Flashcoders] AS3 MouseEvent target?

2008-03-31 Thread Allandt Bik-Elliott (Receptacle)
hi guys in actionscript 3, if i put a mouse event on a movieclip object containing a textfield, should the mouse event be on the movieclip or the textfield? here's my code (comments added to see where the problem is occurring) CODE private function createPeriodBar(dateStart:int,

Re: [Flashcoders] AS3 MouseEvent target?

2008-03-31 Thread Steven Sacks
mc.mouseChildren = false; or event.currentTarget ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] AS3 MouseEvent target?

2008-03-31 Thread Kenneth Kawamoto
Try setting mouseChildren to false Kenneth Kawamoto http://www.materiaprima.co.uk/ Allandt Bik-Elliott (Receptacle) wrote: hi guys in actionscript 3, if i put a mouse event on a movieclip object containing a textfield, should the mouse event be on the movieclip or the textfield? here's my

Re: [Flashcoders] AS3 MouseEvent target?

2008-03-31 Thread jonathan howe
A perfect opportunity for someone more eloquent than I to explain event bubbling. On Mon, Mar 31, 2008 at 4:17 PM, Allandt Bik-Elliott (Receptacle) [EMAIL PROTECTED] wrote: hi guys in actionscript 3, if i put a mouse event on a movieclip object containing a textfield, should the mouse event

Re: [Flashcoders] AS3 MouseEvent target?

2008-03-31 Thread Steven Sacks
IMO, explaining Event Bubbling as the reason the TextField is the target is complicating the immediate solution he needs, which is mouseChildren = false. Yes, it's Event Bubbling that's causing the target to be the TextField. To understand Event Bubbling, read about it in the docs, or better

Re: [Flashcoders] AS3 MouseEvent target?

2008-03-31 Thread Steven Sacks
You shouldn't be using capture phase until you've got a really good handle on bubbling phase first. You shouldn't have bubbling turned on for your button unless you are planning on catching this event above this clip, as well. Event Bubbling means that the TextField is dispatching a bubbling

Re: [Flashcoders] AS3 MouseEvent target?

2008-03-31 Thread Steven Sacks
Take off the true flag for bubbling and set mouseChildren = true. This should solve your issue. Er, I meant set mouseChildren = false. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com