• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 530
  • Last Modified:

AS3 Mouse Event MOUSE_OUT

Hi Guys,

I am having some issues with getting the MOUSE_OUT event to behave.

I have a button movie clip which on MOUSE_OVER expands a box below it with a news item mc in. I want to set it up sp that the close function is triggerd when the mouse leaves the expanded box. This works fine with the exception that if the mouse rolls over the news item within the expanded box it thinks it has left and calls the close function.

Can anyone offer any ideas that would solve this.

Many thanks

S
0
socross
Asked:
socross
  • 3
  • 3
1 Solution
 
AreDubyaCommented:
socoss,

Off the top of my head, if the news item is a child of the thing you want to expand you should be ok.... but, since it seems you aren't ok, could you post an fla to look at?

AreDubya
0
 
socrossAuthor Commented:
Hi there,

Thanks for your reply!

I seem to be running into the same issue, regardless of whether the news item is a child of element I am expanding!

I will double check my code and make sure I am adding the news item as a child!

If this doesn't resolve the issue I will post my fla tomorrow!

Many thanks

s
0
 
AreDubyaCommented:
No worries. I had a similar problem recently, and the fix was obscure enough that I don't want to throw out a bunch of ideas without knowing what I am talking about. ;)

Let me know how it works.

AreDubya
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
socrossAuthor Commented:
Hi aredubya

sorry I have not got back to you sooner, I have not had a chance to look at it yet!

I have been thinking it over, Im assuming that the news mc is not a child of the expanded area because I do not want it to expand/ strech the news items as well!

Would I need to add it ad a child after the expand tween and remove it when I close the news item?

I will post the example fla later today or tomorrow.

Thanks s
0
 
AreDubyaCommented:
socross,

It doesn't necessarily have to be a child of the expanded area. If both were children of a larger container movie clip, and the MOUSE_OUT listener were attached to that you should be good. So, have the rollover of the button expand containerMC.expandBox , and add the MOUSE_OUT listener to containerMC. See how that works for you.

AreDubya
0
 
socrossAuthor Commented:
Hi AreDubya

Thanks for your input on this, the solution was as you suggested, by using the outer container with the bg and news as children of this element.

The only addition was to use the ROLL_OVER event instead of the MOUSE_OVER event as it does not automatically set the .mouseChildren = true.

See: http://flashdevz.wordpress.com/2008/08/23/as3-mousechildren/

Many thanks for all your input.

S
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now