What error?

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of raja_s_patil
Sent: Tuesday, April 14, 2009 12:55 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Create mxml custom component in a actionscript event
handler

 






Hello friends,

refer following code sniplet

/*********************************************** 
private function onItemClick(event:ListEvent):void
{
if ((event.target as List).selectedIndex == 0 )
{
RSP_GenFun.Check_N_Add_MDIWindow(mdiArea, (new Form1()), true);
} 
if ((event.target as List).selectedIndex == 1 )
{
RSP_GenFun.Check_N_Add_MDIWindow(mdiArea, (new Form2()), true);
} 
}
**********************************************/
private function menuSelected(eventObj:MenuTreeSelectionEvent):void
{
var ClassRef:Class = getDefinitionByName(eventObj.FormName) as Class;
mdiArea.windowManager.add(new ClassRef());
}

in this code if I remove comment delimiters the code runs fine
but with the comments it gives error. The reason I spotted is
it could not locate class definitions of Form1 and Form2 mxml
custom components. 

Can somebody guide me how can I achieve this i.e. putting
some probably import statement or some other statement.

The Form1.MXML and Form2.mxml files are in same directory
of application file from which above code is taken

Thanks and Best regards

Raja





Reply via email to