Lets back up a bit here.  As I am understanding, you want to pop-up a
component based on a string value containing the name of the
class(component)?  Is that correct?

 

If so, then you will probably need to use
flash.utils.getDefinitionByNam() to instantiate your popup component,
then use addPopUp() to add it to the childlist of its parent.

 

Some issues include linking the class into application.  Often this is
done using a typed variable..This means you will have to know all of the
classes at compile time.

 

Casting the instantiated class to a type uasble by popUpmanager.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of markgoldin_2000
Sent: Monday, February 11, 2008 5:58 PM
To: [email protected]
Subject: [flexcoders] Re: createPopUp question

 

<Assuming CustomComponent.popWhatToShow is a public string of 
CustomCompontent.
Sorry, but I dont understand what that means.

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, Paul Kukiel <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> I miss read what you were doing earlier.
> try:
> 
> 
> public function showPopupWindow(parent:DisplayObject, 
> WhatToShow:String):void
> 
> {
> 
> var helpWindow:CustomComponent = CustomComponent 
> (PopUpManager.createPopUp(parent, CustomComponent, true);
> helpWindow.popWhatToShow = WhatToShow;
> PopUpManager.centerPopUp(helpWindow);
> }
> 
> Assuming CustomComponent.popWhatToShow is a public string of 
> CustomCompontent.
> 
> Paul.
> 
> 
> On 09/02/2008, at 8:42 AM, markgoldin_2000 wrote:
> 
> > But I can't say WhatToShow:Class because WhatToShow is a class 
name
> > which is a string.
> >
> > --- In [email protected]
<mailto:flexcoders%40yahoogroups.com> , Sherif Abdou <sherif626@> 
wrote:
> > >
> > > public function showPopupWindow( parent:DisplayOb ject,
> > > WhatToShow:Class :void
> > > {
> > > make sure u have it improted too
> > >
> > > ----- Original Message ----
> > > From: markgoldin_2000 <markgoldin_2000@>
> > > To: [email protected]
<mailto:flexcoders%40yahoogroups.com> 
> > > Sent: Friday, February 8, 2008 3:13:57 PM
> > > Subject: [flexcoders] Re: createPopUp question
> > >
> > > I have changed my function to this:
> > > public function showPopupWindow( parent:DisplayOb ject,
> > > WhatToShow:String) :void
> > > {
> > > var helpWindow:WhatToSh ow =
> > > WhatToShow(PopUpMan ager.createPopUp (parent, WhatToShow, 
true));
> > > PopUpManager. centerPopUp( helpWindow) ;
> > > }
> > >
> > > I am getting:
> > > 1046: Type was not found or was not a compile-time constant:
> > > WhatToShow.
> > >
> > > --- In [EMAIL PROTECTED] ups.com, "Paul Kukiel" <pkukiel@ > 
wrote:
> > > >
> > > > Try this:
> > > >
> > > >
> > > >
> > > > var helpWindow:WhatToSh ow = WhatToShow(PopUpMan 
ager.createPopUp
> > > (parent,
> > > > WhatToShow, true);
> > > > PopUpManager. centerPopUp( helpWindow) ;
> > > >
> > > >
> > > >
> > > > Paul.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > From: [EMAIL PROTECTED] ups.com
> > > [mailto:[EMAIL PROTECTED] ups.com] On
> > > > Behalf Of markgoldin_2000
> > > > Sent: Friday, 8 February 2008 4:56 AM
> > > > To: [EMAIL PROTECTED] ups.com
> > > > Subject: [flexcoders] createPopUp question
> > > >
> > > >
> > > >
> > > > Sorry have to ask that again.
> > > > How can I make this function working:
> > > > public function showPopupWindow( parent:DisplayOb ject,
> > > > WhatToShow:String) :void
> > > > {
> > > > var helpWindow:TitleWin dow =
> > > > TitleWindow( PopUpManager. createPopUp( parent, WhatToShow,
> > true));
> > > > PopUpManager. centerPopUp( helpWindow) ;
> > > > }
> > > > createPopUp does not take WhatToShow as a parameter.
> > > >
> > > > Thanks for help.
> > > >
> > >
> > >
> > >
> > >
> > >
> > >
> > __________________________________________________________
> > ______________
> > > Be a better friend, newshound, and
> > > know-it-all with Yahoo! Mobile. Try it now.
> > http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
<http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ> 
> > >
> >
> >
> >
>

 

Reply via email to