There are a couple ways of doing this. You could try RSLs or Modules. Here is a link that talks about doing exactly what you are talking about.
http://flexinonroids.wordpress.com/2009/05/27/flex-3-dynamically-loading-components-at-runtime/ On Fri, Apr 9, 2010 at 3:39 AM, Gireesh <[email protected]> wrote: > > > Hai, > > I wanted to create module at run time using the below code > > var cls:Class = getDefinitionByName("mx.controls.Button") as Class; > var comp:UIComponent = new cls(); > > Right now this is not possible unless I declare a dummy variable of a > Button class in my program to get the compile time linking. > > My question is, when I use Flex 3 framework cache, is it still required to > link the components in compile time ? Will these components wont be > available in Flex framework swz/swf ? > > How can I resolve this ? > > -Gireesh > > >

