We help IT Professionals succeed at work.
Get Started

Child object calls MouseEvent as well.....ending up calling MouseEvent twice.

Last Modified: 2013-11-11

So I created this MovieClip in order to create a dynamic button.  Inside the MovieClip, I have a dynamic TextField.

Basically, when I dynamically put the buttons on stage, I can assign different text to the button depending on what my array contains.

I have a couple problems...
First of all, visually, I dont like what the mouse pointer is doing when it is over the button. When the mouse is over the button, it looks like an Arrow (your normal mouse pointers)...but slide it into the middle where the DynamicTextField resides, and the Mouse turns into a cursor. Its distracting.

Secondly, the MouseEvent. After creating the button dynamically and adding a listener to it, it calls the listener TWICE as you run your mouse pointer over the button. It calls the listener when the pointer is over the button, and then it calls the listener again as the pointer is over the DynamicTextField.

Is there a way around this, or someway I can make it behave like the single button its supposed to be? Its like clicking twice when you really only needed to click once. And as the MouseEvent deletes some objects on stage, running it twice produces unpredictable behaviour.

Thanks in advance!

The problem I am having is on the MouseEvent.
Watch Question
Web Programmer/Technician
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE