---
id: 114
title: 'Adobe Flex : Never try to removeChildren() that are defined in MXML'
slug: adobe-flex-never-try-to-removechildren-that-are-defined-in-mxml
date: '2008-06-14T14:58:00Z'
modified: '2008-06-14T14:58:00Z'
status: publish
type: post
author: pmoelgaard
categories:
  - ActionScript 3.0
  - Adobe Flex
tags:
  - Best Practices
excerpt: null
canonicalPath: /posts/adobe-flex-never-try-to-removechildren-that-are-defined-in-mxml
featuredImage: null
commentCount: 0
wordCount: 95
readingTimeMinutes: 1
hasMedia: false
hasVideos: false
url: >-
  https://forwardthinking.pemo.me/posts/adobe-flex-never-try-to-removechildren-that-are-defined-in-mxml
---
This is a mistake that sometimes works when you try it but in most cases this just causes a lot of heartache. Usually the heartache occurs after you have been doing this for a while and you then have to go back and fix a lot of code that was dependent on the first removeChild(). Unfortunately I have seen this first hand and its not a pretty sight. If you are doing a lot of children manipulation then you will want to move away from MXML declaration and handle the children creation/removal all in ActionScript.
