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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:00:10+00:00 2026-05-26T07:00:10+00:00

I am using several instances of the same custom component on the same SWF.

  • 0

I am using several instances of the same custom component on the same SWF. The component is essentially just a textfield with special sizing requirements. I also have another “wrapper” component that deals with the info from the textfield components. I was initially planning on using the stage index to associate the data with the textfield component it came from. This became more complicated than I anticipated.
When I trace from the wrapper i can’t get the index of the textfield components. So I got it in the component code and sent it with the info to the wrapper via a custom event. The problem there is that i can’t tell which component is which because they are indexed identically. I can also see the component shim as well as the textfield.I’m just really confused about how programmatic components work on the display list.

My main Question. Is there a better way to associate the info with the proper component?
I guess that’s my only question. Please point me in the right direction.

EDIT: I forgot to add that my components are required to be dragged on to stage. Thanks so much for the answer but it will only work for adding the components programmatically. Any help would be greatly appreciated. Even if it’s just a link to a possible solution or info that will help me sort it out. Thanks again.

EDIT2: I created a dummy place-holder component that just draws a rectangle then at runtime replaces it with programmatically generated textfield component. So Thanks so much for everyone that helped me on my way to this solution. If I come up with something better I’ll update this.

  • 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-26T07:00:10+00:00Added an answer on May 26, 2026 at 7:00 am

    You could give each TextField a unique name, like so:

    for(var i:int = 0; i < n; i++)
    {
        var txt:TextField = new MyCustomTextField();
        txt.name = "txt_" + i.toString();
        stage.addChild(txt);
    }
    

    where for example txt[99] = stage.getChildByName("txt_" + 99);

    … or you could use an Array or Vector to hold a reference to each TextField.

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

Sidebar

Related Questions

I'm using MEF to create several instances of the same export. I'd like to
I've been using the same bit of code for several versions of my app
I have several instances in my application. Each of these instances have a Timer
I am using IBOutletCollections to group several Instances of similar UI Elements. In particular
I'd like to know if it's possible to have several instances of Eclipse open
I'm using several variants of the Validator controls (RequiredFieldValidator, CompareValidator, etc) and am using
I am using several NSButtonCell objects in an NSTableView. They are simple square buttons
While using Struts2, I am using several annotations to do my validations inside the
Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different
I am able to connect to an Oracle database using several tools, but am

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.