Ultrashock Forums > Flash > Flash Professional
AS3 mouseEvent buggy and inaccurate (because of being nested within a scaled movie?)

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
AS3 mouseEvent buggy and inaccurate (because of being nested within a scaled movie?)
Old 2010-01-10

Hi all,

I'm having a weird problem with a project I'm working on.

Here's the situation:

It's a map application that scales up and down when you press the arrow keys (basically something like zooming in and out of the map). The map is a movieclip and within that movieclip I have a button (a drawn vector graphic).

It's with this button that I'm having problem. I'm having problem getting accurate mouseover and mouseout events from it. Meaning that even when I'm still moving my mouse over it, I sometimes get a mouseout event.

I'm guessing it has to do because it is being scaled or something (since it it within the map, which is being scaled) and Flash is not registering the "hit area" correctly? But I'm not sure.

Anyone of you guys have encountered something like that before, or know what is causing the problem?

Please let me know!

Thank you!

jonathan.
postbit arrow 5 comments | 282 views postbit arrow Reply: with Quote   
Registered User
jon-khan is offline
seperator
Posts: 27
2006-09-06
jon-khan's Avatar
seperator

Ultrashock Member Comments:
tiran tiran is offline tiran lives in United States 2010-01-11 #2 Old  
This is because your mouseEvent is being interfered with by movieclips inside the movieclip your mouseevent is on. If nothing but the mc that has the mouseevent on it needs to be clicked, you can solve this by setting mouseChildren=false on the mc that has the event attached to it. You can also individually set mc's that are interfering to mouseEnabled=false.
Reply With Quote  
jon-khan's Avatar jon-khan jon-khan is offline 2010-01-11 #3 Old  
Hi Tiran,

Thanks for your reply, but actually, the movieclip that needs to have the mouseEvents doesn't have any children within it. It does have other siblings though, but I need to keep the mouseEvents on those siblings. I don't think it's the mouseEvents on its siblings that's causing the interference? And the mouseEvents on its siblings seem to be working fine by the way. So why is it behaving weirdly...

I'm totally perplexed.

Would you have any other idea why?

Just for your info, and just to describe how it's behaving: simply by moving my mouse over the movieclip, e.g. making rounds over, and without mousing out of it, I'm having mouseOut, mouseOver, mouseOut, mouseOver, mouseOut, mouseOver, etc. being triggered...

Please let me know if you have any other idea.
Thanks!

jonathan.
Reply With Quote  
tiran tiran is offline tiran lives in United States 2010-01-11 #4 Old  
Are you doing anything in the rollOver code to determine the target that was rolled on / off.

for instance:
ActionScript Code:
  1. function over(e:MouseEvent){
  2. var targ = e.target;
  3. }

If so are you familiar with the difference between "target" and "currentTarget"?

Other than that its tough without seeing code or an example.
Reply With Quote  
jon-khan's Avatar jon-khan jon-khan is offline 2010-01-12 #5 Old  
Hi Tiran,

I tried identifying the target using target and currentTarget but I dont think it's the problem... Anyway, I will try to put up a stripped down version of my Flash and will let you know (cos the actual current version is so complicated).

Thanks!

jonathan.
Reply With Quote  
jon-khan's Avatar jon-khan jon-khan is offline 2010-01-31 #6 Old  
Hey Tiran,

Just wanted to let you know that I've solved the problem. The "bugginess" in the mouse over event was actually due to an invisible movieclip which was on top my movieclip, and which was following the mouse. So when I was rolling over the invisible movieclip, it was capturing a "mouse out" event from my movieclip! haha damit...

Anyway, thanks for your help!

jonathan.
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: