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

  • SEARCH
  • Home
  • 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 8079563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:08:44+00:00 2026-06-05T16:08:44+00:00

So I generated 65 movieclips inside a container movieclip. (It’s in a container due

  • 0

So I generated 65 movieclips inside a container movieclip. (It’s in a container due to this being on a game and it’s within a popup.) The MovieClips are created by accessing an AS3 linked MovieClip in the library. Each one is stored in an array of MovieClips. From there I put some text information (including some hidden text) into each one and add some event listeners. The code itself works just fine except for one thing. The Event Listener receives the target as one of the TextFields inside the MovieClip instead of the MovieClip itself. I made absolute certain that the Mouse Event Listeners were applied to the movieclips.

for (var i:int = 0; i < mcArray.length; i++)
{
    mcArray[i] = new IDButton();
    MovieClip(mcArray[i]).tf1.text = String(ID1[i])
    MovieClip(mcArray[i]).tf2.text = String(ID2[i]);
    MovieClip(mcArray[i]).tf3.text = String(ID3[i]);
    MovieClip(mcArray[i]).tf1.selectable = false;
    MovieClip(mcArray[i]).tf2.selectable = false;
    MovieClip(mcArray[i]).tf3.selectable = false;
    MovieClip(mcArray[i]).tf1.visible = false;
    MovieClip(mcArray[i]).tf2.visible = false;
    MovieClip(mcArray[i]).name = "MC" + String(i);
    container.addChild(MovieClip(mcArray[i]));
    MovieClip(mcArray[i]).addEventListener(MouseEvent.CLICK, mcClickHandler);
    MovieClip(mcArray[i]).addEventListener(MouseEvent.ROLL_OVER, mcHoverHandler);
    MovieClip(mcArray[i]).addEventListener(MouseEvent.ROLL_OUT, mcOffHandler);
    MovieClip(mcArray[i]).x = 0;
    MovieClip(mcArray[i]).y = MovieClip(mcArray[i]).height * i;
}

(To be honest I’ve no idea if having the MovieClip there is redundant. I suppose it shows my general lack of trust in flash.)

So to test I traced the target name in the mcClickHandler function and it kept returning “tf3”.

  • 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-06-05T16:08:45+00:00Added an answer on June 5, 2026 at 4:08 pm

    Events in AS3 have two “target” properties: target and currentTarget. If one isn’t working, the other usually will.

    Basically, target is the actual object that the mouse clicked, and currentTarget is the object that has the listener attached to it.

    More info in this SO question: Difference between e.target and e.currentTarget

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

Sidebar

Related Questions

I'm making a random generated floor, but when a movieclip walks on it ,
I generated this Minimum Spanning Tree using Kruskal algorithm and I have a hard
In my document class, I generate a bunch of movieclips, then position them within
I generated this class using SQLMetal.exe. It is very bindable at runtime, but if
I generated this xml file by marshalling it and then i want to unmarshall
I have a movieclip in my library named mcLeaderboarditem. I've generated a class for
I have a MovieClip holding an irregular shape such as this one: I need
I generated script from old database, created a new database and imported all data
I'm working on a small game in Flash (AS3) that generates levels using small
I generated a table demo of something similar to what I have on my

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.