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 6770539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:19:28+00:00 2026-05-26T15:19:28+00:00

Background Information: I am using Adobe Flash CS4 I am using Actionscript 3 I

  • 0

Background Information:

  • I am using Adobe Flash CS4
  • I am using Actionscript 3
  • I am publishing my code into an Adobe AIR document, however I am not sure that this is relevant to this particular problem.

  • I’ve created two symbols in the library, large rectangles, and placed instances of them on the stage.

  • I’m using “getObjectsUnderPoint” to detect the objects under where the mouse is clicked.
  • I have verified that getObjectsUnderPoint is detecting the symbol instances by tracing the names.

The Problem

  • The traced names of the objects detected by getObjectsUnderPoint are all instance1, instance2, instance3, etc. even though I have named the instances.
  • This causes an issue when trying to ensure that the mouse was clicked on a zone encompassed by either one of the rectangles, as I can’t check if object[i].name == “leftbox” , and the instance1, instance2, etc. names change as I add/remove things from the stage, so I do not want to check for instance2 and instance3 (which are as of right now the 2 boxes I’ve created, which are named “leftbox” and “rightbox” respectively.

The Question:

Am I doing something wrong in detecting the names? How do I actually detect the instance names that I have created on the stage through the ActionScript in my class?

Here is my code:

        var pt:Point = new Point(e.stageX, e.stageY);
        var objects:Array = getObjectsUnderPoint(pt);
        var action = 0;

        for(var i=0; i< objects.length; i++) {
            trace(objects[i].name);
        }

        if( objects.indexOf('left_box') >= 0 ){
            action = 1;

        }
        if(objects.indexOf('right_box') >= 0 ){
            action = 2;

        }
  • 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-26T15:19:28+00:00Added an answer on May 26, 2026 at 3:19 pm

    Taking forward Fahim Akhter’s answer,

    You can then loop to get the parent until the object is a movieclip

    var o:DisplayObject=objects[i];
    while(!(o.parent is MovieClip)) {
        o=o.parent;
    }
    var myMovieClip:MovieClip=o.parent;
    

    This should give you a movie clip in myMovieClip and when you trace myMovieClip.name, you’ll get what you are looking for.

    This will also work for multiple level symbols (where 1 symbol contains another)

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

Sidebar

Related Questions

Some background information: We have an ancient web-based document database system where I work,
Background information first: We are using a strongly-typed DataSet to manage transaction files. That
Background information: This application is .NET 4/C# Windows Forms using SQLite as it's backend.
Background information: I have been writing code to control a device attached by a
Background Users type information into web form inputs such as: <input type=text name=report_name value=First
The background information, libraries and sample code on the Joe Lynds site is really
This question contains a lot of background information, to make sure you fully understand
Background Information: Ultimately, I would like to write an emulator of a real machine
As usual, some background information first: Database A (Access database) - Holds a table
And if you do, can you give some background information on the implementation and

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.