Re: [Flashcoders] MouseEvents on overlapping siblings in AS3
yeh hittests are the slowest way of doing things but they have their place On Wed, Sep 3, 2008 at 9:26 AM, Matthias Dittgen <[EMAIL PROTECTED]>wrote: > Thanks for all the answers!!! > > So I went back to a solution where the upper MovieClip listens to the > MouseMove event and hittest while the lower MovieClip is using > Rollover now. That works for me. But nonetheless it is frustrating > that there is no other way to get an ROLLOVER event for two or even > more overlapping siblings other than hittesting them all. > When it comes to performance - hittests are usually more cpu intensive > than rollovers, right? > > > On Tue, Sep 2, 2008 at 7:31 PM, Meinte van't Kruis <[EMAIL PROTECTED]> > wrote: > > I think rollover means it will fire once, wether or not it 'rolls' over a > > child of that parent. With mouseover, > > the event will fire each time the mouse also get's over a child of the > > parent which is listening to the event. > > (in short; rollover is like a parent with mouseover only with > mousechildren > > set to false). > > > > On Tue, Sep 2, 2008 at 5:26 PM, EECOLOR <[EMAIL PROTECTED]> wrote: > > > >> Just a guess, but you could change the listener to MOUSE_OVER instead of > >> ROLL_OVER. The difference between the two is very subtle and explained > at > >> the reference documentation of InteractiveObject. I am not sure if it is > >> applicable to the problem posed. > >> > >> Greetz Erik > >> ___ > >> Flashcoders mailing list > >> Flashcoders@chattyfig.figleaf.com > >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >> > > > > > > > > -- > > M.A. van't Kruis > > http://www.malatze.nl/ > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseEvents on overlapping siblings in AS3
Thanks for all the answers!!! So I went back to a solution where the upper MovieClip listens to the MouseMove event and hittest while the lower MovieClip is using Rollover now. That works for me. But nonetheless it is frustrating that there is no other way to get an ROLLOVER event for two or even more overlapping siblings other than hittesting them all. When it comes to performance - hittests are usually more cpu intensive than rollovers, right? On Tue, Sep 2, 2008 at 7:31 PM, Meinte van't Kruis <[EMAIL PROTECTED]> wrote: > I think rollover means it will fire once, wether or not it 'rolls' over a > child of that parent. With mouseover, > the event will fire each time the mouse also get's over a child of the > parent which is listening to the event. > (in short; rollover is like a parent with mouseover only with mousechildren > set to false). > > On Tue, Sep 2, 2008 at 5:26 PM, EECOLOR <[EMAIL PROTECTED]> wrote: > >> Just a guess, but you could change the listener to MOUSE_OVER instead of >> ROLL_OVER. The difference between the two is very subtle and explained at >> the reference documentation of InteractiveObject. I am not sure if it is >> applicable to the problem posed. >> >> Greetz Erik >> ___ >> Flashcoders mailing list >> Flashcoders@chattyfig.figleaf.com >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> > > > > -- > M.A. van't Kruis > http://www.malatze.nl/ > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseEvents on overlapping siblings in AS3
I think rollover means it will fire once, wether or not it 'rolls' over a child of that parent. With mouseover, the event will fire each time the mouse also get's over a child of the parent which is listening to the event. (in short; rollover is like a parent with mouseover only with mousechildren set to false). On Tue, Sep 2, 2008 at 5:26 PM, EECOLOR <[EMAIL PROTECTED]> wrote: > Just a guess, but you could change the listener to MOUSE_OVER instead of > ROLL_OVER. The difference between the two is very subtle and explained at > the reference documentation of InteractiveObject. I am not sure if it is > applicable to the problem posed. > > Greetz Erik > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- M.A. van't Kruis http://www.malatze.nl/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseEvents on overlapping siblings in AS3
Just a guess, but you could change the listener to MOUSE_OVER instead of ROLL_OVER. The difference between the two is very subtle and explained at the reference documentation of InteractiveObject. I am not sure if it is applicable to the problem posed. Greetz Erik ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseEvents on overlapping siblings in AS3
Hi, I think you could make one item the parent of another so you could listen to rollover events on both objects. If A is the parent, you might to make A or B a custom object so that events from the child will get passed up to the grandparent "C" via event bubbling. If you have a B as child of A, when you rollover A, you get an over event, when you rollover B within A, A rolls-out and B rolls-over, so you need to handle this. You also need to handle the "Release Outside" issue - AS2 did this nicely, now you have to listen for MouseEvent.MOUSE_UP to find this out as MOUSE_OUT does not seem to work when your button is down - I may be wrong, but this has caused problems for me recently. Glen Meinte van't Kruis wrote: I'm actually talking here where A and B have no relation whatsoever, so perhaps my question doesn't belong in this thread, when I read the follow line, I actually guess it's impossible for B to receive any MouseEvent when A is enabled and overlapping it: 'This means that even if no event handlers have been assigned to a particular display object, it will still be targeted for an event when clicked, preventing anything below it from receiving events.' On Tue, Sep 2, 2008 at 12:55 PM, Meinte van't Kruis <[EMAIL PROTECTED]>wrote: Could you elaborate? Maybe I'm missing something but if you have two mouse enabled objects (where A completely overlaps B), I don't see any way to know if a mouse is over object B, I've tried different ways, but haven't been able to do it.. On Fri, Aug 29, 2008 at 3:31 PM, eric e. dolecki <[EMAIL PROTECTED]>wrote: Think you need to drink some "bubbly" - bubbling events On Fri, Aug 29, 2008 at 8:40 AM, Matthias Dittgen <[EMAIL PROTECTED] wrote: but imagine one of the mc overlapping the whole other mc. MovieClips: A and B. A is overlapping B if the mouse is over A but not over B: i want receive a ROLL_OVER for A if the mouse is over A and over B: i want receive a ROLL_OVER for A and a ROLL_OVER for B an I don't want to replace them. A and B are siblings and will always be siblings. On Fri, Aug 29, 2008 at 1:30 PM, <[EMAIL PROTECTED]> wrote: drop them in a movieclip and add an event Listener to that --Original Message-- From: Matthias Dittgen Sender: To: Flash Coders List ReplyTo: Flash Coders List Sent: Aug 29, 2008 6:03 AM Subject: [Flashcoders] MouseEvents on overlapping siblings in AS3 Hello, this was probably asked before, but I can't find. Imagine two or more sibling MovieClips. Both listen to MouseEvent.ROLL_OVER. When the mouse rolls over the overlapping region I would like the event to be dispatched to both of them and not only to the one above the other? How can I achieve this without using hitTest or enterframe scripts? Regards, Matthias ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Sent via BlackBerry from T-Mobile ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- M.A. van't Kruis http://www.malatze.nl/ -- Glen Pike 01326 218440 www.glenpike.co.uk <http://www.glenpike.co.uk> ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseEvents on overlapping siblings in AS3
I'm actually talking here where A and B have no relation whatsoever, so perhaps my question doesn't belong in this thread, when I read the follow line, I actually guess it's impossible for B to receive any MouseEvent when A is enabled and overlapping it: 'This means that even if no event handlers have been assigned to a particular display object, it will still be targeted for an event when clicked, preventing anything below it from receiving events.' On Tue, Sep 2, 2008 at 12:55 PM, Meinte van't Kruis <[EMAIL PROTECTED]>wrote: > Could you elaborate? Maybe I'm missing something but if you have two mouse > enabled objects > (where A completely overlaps B), I don't see any way to know if a mouse is > over object B, I've tried > different ways, but haven't been able to do it.. > > > On Fri, Aug 29, 2008 at 3:31 PM, eric e. dolecki <[EMAIL PROTECTED]>wrote: > >> Think you need to drink some "bubbly" - bubbling events >> >> On Fri, Aug 29, 2008 at 8:40 AM, Matthias Dittgen <[EMAIL PROTECTED] >> >wrote: >> >> > but imagine one of the mc overlapping the whole other mc. >> > >> > MovieClips: A and B. A is overlapping B >> > >> > if the mouse is over A but not over B: i want receive a ROLL_OVER for A >> > if the mouse is over A and over B: i want receive a ROLL_OVER for A >> > and a ROLL_OVER for B >> > >> > an I don't want to replace them. A and B are siblings and will always >> > be siblings. >> > >> > >> > On Fri, Aug 29, 2008 at 1:30 PM, <[EMAIL PROTECTED]> wrote: >> > > drop them in a movieclip and add an event Listener to that >> > > --Original Message-- >> > > From: Matthias Dittgen >> > > Sender: >> > > To: Flash Coders List >> > > ReplyTo: Flash Coders List >> > > Sent: Aug 29, 2008 6:03 AM >> > > Subject: [Flashcoders] MouseEvents on overlapping siblings in AS3 >> > > >> > > Hello, >> > > >> > > this was probably asked before, but I can't find. >> > > Imagine two or more sibling MovieClips. Both listen to >> > > MouseEvent.ROLL_OVER. When the mouse rolls over the overlapping region >> > > I would like the event to be dispatched to both of them and not only >> > > to the one above the other? How can I achieve this without using >> > > hitTest or enterframe scripts? >> > > >> > > Regards, >> > > Matthias >> > > ___ >> > > Flashcoders mailing list >> > > Flashcoders@chattyfig.figleaf.com >> > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> > > >> > > >> > > Sent via BlackBerry from T-Mobile >> > > ___ >> > > Flashcoders mailing list >> > > Flashcoders@chattyfig.figleaf.com >> > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> > > >> > ___ >> > Flashcoders mailing list >> > Flashcoders@chattyfig.figleaf.com >> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> > >> ___ >> Flashcoders mailing list >> Flashcoders@chattyfig.figleaf.com >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> > > > > -- > M.A. van't Kruis > http://www.malatze.nl/ > -- M.A. van't Kruis http://www.malatze.nl/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseEvents on overlapping siblings in AS3
Could you elaborate? Maybe I'm missing something but if you have two mouse enabled objects (where A completely overlaps B), I don't see any way to know if a mouse is over object B, I've tried different ways, but haven't been able to do it.. On Fri, Aug 29, 2008 at 3:31 PM, eric e. dolecki <[EMAIL PROTECTED]> wrote: > Think you need to drink some "bubbly" - bubbling events > > On Fri, Aug 29, 2008 at 8:40 AM, Matthias Dittgen <[EMAIL PROTECTED] > >wrote: > > > but imagine one of the mc overlapping the whole other mc. > > > > MovieClips: A and B. A is overlapping B > > > > if the mouse is over A but not over B: i want receive a ROLL_OVER for A > > if the mouse is over A and over B: i want receive a ROLL_OVER for A > > and a ROLL_OVER for B > > > > an I don't want to replace them. A and B are siblings and will always > > be siblings. > > > > > > On Fri, Aug 29, 2008 at 1:30 PM, <[EMAIL PROTECTED]> wrote: > > > drop them in a movieclip and add an event Listener to that > > > --Original Message-- > > > From: Matthias Dittgen > > > Sender: > > > To: Flash Coders List > > > ReplyTo: Flash Coders List > > > Sent: Aug 29, 2008 6:03 AM > > > Subject: [Flashcoders] MouseEvents on overlapping siblings in AS3 > > > > > > Hello, > > > > > > this was probably asked before, but I can't find. > > > Imagine two or more sibling MovieClips. Both listen to > > > MouseEvent.ROLL_OVER. When the mouse rolls over the overlapping region > > > I would like the event to be dispatched to both of them and not only > > > to the one above the other? How can I achieve this without using > > > hitTest or enterframe scripts? > > > > > > Regards, > > > Matthias > > > ___ > > > Flashcoders mailing list > > > Flashcoders@chattyfig.figleaf.com > > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > > > > Sent via BlackBerry from T-Mobile > > > ___ > > > Flashcoders mailing list > > > Flashcoders@chattyfig.figleaf.com > > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- M.A. van't Kruis http://www.malatze.nl/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseEvents on overlapping siblings in AS3
Here's a very good article about how mouse events propagate. http://www.adobe.com/devnet/actionscript/articles/event_handling_as3.html You should be able to have more than one MC capture a single event, although I haven't tried it. A On Fri, Aug 29, 2008 at 8:03 PM, Matthias Dittgen <[EMAIL PROTECTED]>wrote: > Hello, > > this was probably asked before, but I can't find. > Imagine two or more sibling MovieClips. Both listen to > MouseEvent.ROLL_OVER. When the mouse rolls over the overlapping region > I would like the event to be dispatched to both of them and not only > to the one above the other? How can I achieve this without using > hitTest or enterframe scripts? > > Regards, > Matthias > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseEvents on overlapping siblings in AS3
Poetry!!! and yet, a good answer Le 29 août 08 à 15:31, eric e. dolecki a écrit : Think you need to drink some "bubbly" - bubbling events On Fri, Aug 29, 2008 at 8:40 AM, Matthias Dittgen <[EMAIL PROTECTED]>wrote: but imagine one of the mc overlapping the whole other mc. MovieClips: A and B. A is overlapping B if the mouse is over A but not over B: i want receive a ROLL_OVER for A if the mouse is over A and over B: i want receive a ROLL_OVER for A and a ROLL_OVER for B an I don't want to replace them. A and B are siblings and will always be siblings. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseEvents on overlapping siblings in AS3
Think you need to drink some "bubbly" - bubbling events On Fri, Aug 29, 2008 at 8:40 AM, Matthias Dittgen <[EMAIL PROTECTED]>wrote: > but imagine one of the mc overlapping the whole other mc. > > MovieClips: A and B. A is overlapping B > > if the mouse is over A but not over B: i want receive a ROLL_OVER for A > if the mouse is over A and over B: i want receive a ROLL_OVER for A > and a ROLL_OVER for B > > an I don't want to replace them. A and B are siblings and will always > be siblings. > > > On Fri, Aug 29, 2008 at 1:30 PM, <[EMAIL PROTECTED]> wrote: > > drop them in a movieclip and add an event Listener to that > > --Original Message-- > > From: Matthias Dittgen > > Sender: > > To: Flash Coders List > > ReplyTo: Flash Coders List > > Sent: Aug 29, 2008 6:03 AM > > Subject: [Flashcoders] MouseEvents on overlapping siblings in AS3 > > > > Hello, > > > > this was probably asked before, but I can't find. > > Imagine two or more sibling MovieClips. Both listen to > > MouseEvent.ROLL_OVER. When the mouse rolls over the overlapping region > > I would like the event to be dispatched to both of them and not only > > to the one above the other? How can I achieve this without using > > hitTest or enterframe scripts? > > > > Regards, > > Matthias > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > Sent via BlackBerry from T-Mobile > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseEvents on overlapping siblings in AS3
but imagine one of the mc overlapping the whole other mc. MovieClips: A and B. A is overlapping B if the mouse is over A but not over B: i want receive a ROLL_OVER for A if the mouse is over A and over B: i want receive a ROLL_OVER for A and a ROLL_OVER for B an I don't want to replace them. A and B are siblings and will always be siblings. On Fri, Aug 29, 2008 at 1:30 PM, <[EMAIL PROTECTED]> wrote: > drop them in a movieclip and add an event Listener to that > --Original Message-- > From: Matthias Dittgen > Sender: > To: Flash Coders List > ReplyTo: Flash Coders List > Sent: Aug 29, 2008 6:03 AM > Subject: [Flashcoders] MouseEvents on overlapping siblings in AS3 > > Hello, > > this was probably asked before, but I can't find. > Imagine two or more sibling MovieClips. Both listen to > MouseEvent.ROLL_OVER. When the mouse rolls over the overlapping region > I would like the event to be dispatched to both of them and not only > to the one above the other? How can I achieve this without using > hitTest or enterframe scripts? > > Regards, > Matthias > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > Sent via BlackBerry from T-Mobile > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseEvents on overlapping siblings in AS3
drop them in a movieclip and add an event Listener to that --Original Message-- From: Matthias Dittgen Sender: To: Flash Coders List ReplyTo: Flash Coders List Sent: Aug 29, 2008 6:03 AM Subject: [Flashcoders] MouseEvents on overlapping siblings in AS3 Hello, this was probably asked before, but I can't find. Imagine two or more sibling MovieClips. Both listen to MouseEvent.ROLL_OVER. When the mouse rolls over the overlapping region I would like the event to be dispatched to both of them and not only to the one above the other? How can I achieve this without using hitTest or enterframe scripts? Regards, Matthias ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Sent via BlackBerry from T-Mobile ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] MouseEvents on overlapping siblings in AS3
Hello, this was probably asked before, but I can't find. Imagine two or more sibling MovieClips. Both listen to MouseEvent.ROLL_OVER. When the mouse rolls over the overlapping region I would like the event to be dispatched to both of them and not only to the one above the other? How can I achieve this without using hitTest or enterframe scripts? Regards, Matthias ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders