Adding custom components via actionscript

I know how to add components using the mx tag so <custom:email_cmp/>

but States are really bothering me. So I would to add the component through actionscript, and delete it after