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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:34:05+00:00 2026-06-04T08:34:05+00:00

I have problem with removeChild in XML button menu im calling button temp from

  • 0

I have problem with removeChild in XML button menu
im calling button temp from library with Linkage
here is my code where i write it

        var genButton:butonProba;

    var i:uint = 0;

    for each (var page:XML in generacijeXML.gener.generation) {

        genButton = new butonTest();    

        genButton.butonText.text = page.@name;

        genButton.source = page.source.toString();

        genButton.butonText.autoSize = TextFieldAutoSize.LEFT;

        genButton.x = 16 + i*225;
        genButton.y = -30;

        genButton.buttonMode = true;
        genButton.mouseChildren = false;

        addChild(genButton);

        i++;
}

and everything is normal…..

now when i want to make 1 more button when i click on it i want to remove all xml buttons which i call before

im trying simple like this

close.addEventListener(MouseEvent.CLICK, closed);

  function closed(event:Event):void {
  genButton.removeChild(0);
}

and this

close.addEventListener(MouseEvent.CLICK, closed);

  function closed(event:Event):void {
  removeChild(genButton);
}

but dont work
does any1 have idea how can i do that ???

  • 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-04T08:34:07+00:00Added an answer on June 4, 2026 at 8:34 am

    I would add all buttons in one container. Create the container as an instance member and add it to the stage in the constructor or your init method:

     public var buttonContainer:Sprite = new Sprite();
     addChild(buttonContainer);
    

    In your loop add all the created buttons to this container:

     ...
     genButton.buttonMode = true;
     genButton.mouseChildren = false;
    
     buttonContainer.addChild(genButton);
    
     i++;
    

    in you click handler remove all children from the container:

     close.addEventListener(MouseEvent.CLICK, closed);
    
     function closed(event:Event):void {
         while(buttonContainer.numChildren > 0 )
         {
              buttonContainer.removeChildAt(0);
         }
     }
    

    hope that helped

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

Sidebar

Related Questions

I have a problem with the use of the javascript removeChild function. Here's my
i have problem to pass data from view to controller , i have view
I have problem with css styles in aspx.cs file HttpContext.Current.Response.Write(<table class=\'bordered\' cellpadding=\'5\' color: \'red\'
I have created a PHP script which builds a table from an XML document
well I have a problem with my code : - (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
The Problem I have the following code: <html> <head> <style id=ID_Style> .myStyle { color
I have problem with this method in NLog library: NLog.Targets.Wrappers.AsyncTargetWrapper.ProcessPendingEvents(object state) It consume too
I have problem with passing variables through views. But, first some code // i
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem with consuming DbContext class in EF 4.3 CodeFirst approach. As for

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.