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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:36:16+00:00 2026-05-21T20:36:16+00:00

Im currently creating textfields in a for loop – though in this example only

  • 0

Im currently creating textfields in a for loop – though in this example only creating one TextField.

My questions is, how do I remove the TextField child in another function?
What im basically doing is, create a Textfield, addchild to a container – > then the container into another position – > then removechild and another text in the container. I’ve tried something like:

removeChild( getChildByName(myTextField2) );

edit: perhaps a solution for me could also just to be able to change the text of the TextField to something else, rather than removing it and adding a new one.

public function handleTextFrames(numberOfFrames:Number, textFrame1:String, textFrame2:String, textFrame3:String, textFrame4:String):void

    {

        var textArray:Array = new Array(textFrame1,textFrame2,textFrame3,textFrame4);

        // Creating font instance
        var garageInstance:Font = new garage();

        //Creating the textfield object and naming it "myTextField"
        var myTextField:TextField = new TextField();

        //Here we add the new textfield instance to the stage with addchild()
        textContainer.alignContainer1.addChild(myTextField);

        //myTextField.width = 930;
        myTextField.embedFonts = true;
        myTextField.multiline = true;
        myTextField.wordWrap = false;
        myTextField.selectable = false;

        var myText:String = textArray[0];

        myTextField.htmlText = myText;

        //This last property for our textfield is to make it autosize with the text, aligning to the left.
        myTextField.autoSize = TextFieldAutoSize.LEFT;

        //This is the section for our text styling, first we create a TextFormat instance naming it myFormat
        var myFormat:TextFormat = new TextFormat();

        //Embedding font
        myFormat.font = garageInstance.fontName;

        myFormat.color = 0xffffff;
        myFormat.size = 60;
        myFormat.align = TextFormatAlign.CENTER;


        //Now the most important thing for the textformat, we need to add it to the myTextField with setTextFormat.
        myTextField.setTextFormat(myFormat);

        myTextField.y = textContainer.alignContainer1.height * 0.5 - myTextField.textHeight * 0.5;
        myTextField.x = payoffContainer_mc.width / 2 - myTextField.textWidth / 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-21T20:36:17+00:00Added an answer on May 21, 2026 at 8:36 pm

    What exactly do you want to do? 🙂 Because if you keep the textfields in a “global” array, that would solve it.

    Let’s say you keep it in an array, called textfields.

    var textfields:Array = [];
    

    You push everything in to this, by

    textfields.push(textfield);
    

    Then, at any time, you can remove this by calling this function:

    textfields[0].parent.removeChild(textfields[0]);
    

    concerning the first element. In flash this always works:

    INSTANCE.parent.removeChild(INSTANCE);
    

    Does this help?

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

Sidebar

Related Questions

I'm currently creating an explicit reference to this in the outer class so that
I'm currently creating an application for a customer that will allow them to automatically
I'm currently creating a WinForm in VB.NET bound to an access database. Basically what
I am currently creating an e-commerce site using C# ASP.NET MVC and have just
I'm currently working on creating a new C# project that needs to interact with
Currently I have the function CreateLog() for creating a a log4net Log with name
We currently deploy web applications by creating a database and running SQL scripts through
I am currently in the process of creating my own blog and I have
I'm currently planning out a project involving creating a shell replacement for Windows (based
Is there a way in Cocoa that is currently considered best practice for creating

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.