Thanks Tracy Spratt, > > The compiler compiles the function regardless of whether it is ever called, > If you reference a class that it cannot find it will error. > > > > No, if you are using normal classes, then you must have a reference to that > class in order for it to be linked in at compile. This is one of the > problems the Modules are intended to address. Note, the reference can > simply be a variable declaration typed as the class.
Well I Found the solution.......... Flex compiler's artificial intelligence doesn't link all the imported classes unless those are refered somewhere in the code. So its necessary to refer the class somewhere in the application. So what i did was I declared a dummy variable var frm1:Form1 = null; var frm2:Form2 = null; and it worked like a magic now dynamic creation works like a charm. Please refer to this URL http://jwopitz.wordpress.com/2008/02/21/getdefinitionbyname-trick/ its claimed that this is a elegant way of achieving same result but I could not understand it properly. If possible can u elaborate the technique he has used in ur next post. > > But I am still more confused about your problem. Let's try again. Can you > instantiate Form1 if you wanted to? > I think u might have got exact problem from above mentioned text. If possible please comment on what I have done whether its a best practice or not and suggest better alternative. Thanks for interest shown and time spent on me. I feel that I have got another good friend now. Best regards RAJA