A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: remove textbox

  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    10

    remove textbox

    The following code are used to create my text boxes, but I couldn't remove them with remove Child, is there a way remove all of the textboxes at once. All help appreciated

    Code:
    function createBoxes():void {
    			textBoxArray=[];
    			for (var i:uint=2; i<colum; i++) {
    				textBoxArray[i] =new Array();
    				for (var j:uint=3; j<row; j++) {
    					textBox = new TextField();
    					textBox.x = (textBox.width-70)* j;
    					textBox.y = (textBox.height-70)* i;
    					textBoxArray[i][j]=textBox;
    					addChild(textBox);
    				}
    			}
    		}

  2. #2
    Senior Member
    Join Date
    Apr 2004
    Location
    LA
    Posts
    349
    How did you try to remove them?
    Write multiplayer games with FlashMOG 0.3.1
    Try the MyPlan Salary Calculator

  3. #3
    Senior Member
    Join Date
    Jul 2008
    Posts
    391
    You could do
    Code:
    var textboxes:Sprite = new Sprite ();
    this.addChild (textboxes);
    //loop
    textboxes.addChild (textBox);
    //end loop
    
    //remove
    while (textboxes.numChildren > 0) {
      textboxes.removeChildAt (0);
    }//This is assuming you want to remove every single textbox
    Easier to manage if you put all the textboxes into a container.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center