assign unique name to each of the UIComponents adding to the container ( default stage )
by using the name property of the components you can get the object from the container using
container.getChildByName("name assigned to the property") this function will return as DisplayObject
typecast the DisplayObject to the target class to that you can edit the object.
var sp:Sprite = myContainer.getChildByName("one") as Sprite; // here I am getting sprite reference with name 'one' from 'myContainer'
sp.x=sp.x + 10; // here I am editing the property 'x' of the Sprite whose name is 'one'
Note : similarly you can perform operation on the sprite
removeChild will be used to remove the child from the container where it is added
container.removeChild(container.getChildByName("name assigned to the property"));
If this post answers your question or helps, please mark it as such
Thanks for the mail.
I have done the same.
But now the problem is the components to be added or deleted are having the child components on it.when i try to set their properties at Runtime,it is throwing "Can't access property or method of a null object reference".
Find the attachment to understand the problem description
I understand these child component of the component to be added/deleted are not created and calling at runtime ,so i appreciate any of your further suggestions or input are more helpful for me:
Thanks in advance