Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6055117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:13:42+00:00 2026-05-23T08:13:42+00:00

I wonder if you can help with something I imagine is relatively simple –

  • 0

I wonder if you can help with something I imagine is relatively simple – but amazingly frustrating!

I have a list of movie clips that each contain a button with an instance name Mbtn. I would like the button to appear only when the mouse hovers over the parent clip. The structure is basically a parent clip called pcs, 5 child clips (named below) each containing a button with an instance name of mBtn. here is my code –

hr_pc.mBtn.visible=false;
m_pc.mBtn.visible=false;
me_pc.mBtn.visible=false;
d_pc.mBtn.visible=false;
di_pc.mBtn.visible=false;




pcs.addEventListener(MouseEvent.ROLL_OVER, mOver);
pcs.addEventListener(MouseEvent.ROLL_OUT, mOut);

function mOver(evt:MouseEvent):void
{
var overNow = evt.currentTarget.name;
overNow.mBtn.visible=true;


}
function mOut(evt:MouseEvent):void
{
var overNot = evt.currentTarget.name;
overNot.mBtn.visible=false;
} 

I’m sure there’s a much better way to do this – any suggestions very gratefully received!

Thanks
Paul

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:13:43+00:00Added an answer on May 23, 2026 at 8:13 am
    evt.currentTarget.name
    

    means that, right now, you are targeting your container object (pcs), and not the contents (hr_pc, m_pc etc). This is the key difference between evt.target and evt.currentTarget. If you trace out the currentTarget name, it will be identical for each intended target.
    So, to rectify,you can certainly make this work with

    evt.target.name
    

    You may have issues, however, if you mouse over the button, as the target will no longer be the buttons direct parent (it will be the button itself), and the button is likely to trigger visible=false again.

    I would probably go a different direction with this: write a class that contains the button and its own listeners. This would be a good plan if there is a lot of shared behavior (but depending on your needs, may not be).

    So, yeah, read up on currentTarget vs target

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

wonder whether someone can help me with the following one... I have a struct
I wonder if anyone can help - I have this error showing recently when
I'm working on a browser-game and I can't help but wonder about what's the
I wonder if anyone can help with the following. I have integrated both iAds
I wonder if someone can help me with this. I have a LINQ query
Having a look at BDD frameworks and I can't help but wonder which one
Wonder if anyone can help me understand how to sum up the column of
I wonder if anyone can help improve my understanding of JOINs in SQL. [If
I wonder if someone can help me. I'm trying to add a reference to
I wonder if someone can help me. I'm trying to display a toast element

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.