I think the best way to pass values to popup window is to use init object methodology.

Declare variables in myPopup.mxml

For example

            var firstName:String;

            var lastName:String;

 

In the parent mxml file

Create an object. Assign values to above said attributes.

Example

            var initObj:Object = new Object();

            initObj.firstName = “zzzzzz”;         // should match variable declared in myPopup.mxml

            initObj.lastName = “xxxxxxx”;       // should match variable declared in myPopup.mxml

 

then pass this initObj

 

var popupWindow:TitleWindow = TitleWindow(PopUpManager.createPopUp(this, myPopup, true,initObj));    

 

 

Thanks!
Hari

-----Original Message-----
From:
flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Spike
Sent: Tuesday, October 18, 2005 10:43 AM
To:
flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex 2: Passing to a PopupWindow

 

Here's one way to do it:

**********************************************************
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*">
   
    <mx:Script>
        <![CDATA[
            import mx.managers.PopUpManager;
            import mx.containers.TitleWindow;
            import mx.controls.TextInput;
           
            private function showPopUp(event:Event):Void  {
                var tw:TitleWindow = new TitleWindow();
                tw.title = "My Title";
               
                var input:TextInput = new TextInput();
                input.text = "Hello!";
                tw.addChild(input);
               
                PopUpManager.popUpWindow(tw, this, false);
            }

           
           
        ]]>
    </mx:Script>
   
   
    <mx:Button label="Test popup" click="showPopUp(event);" />
   
</mx:Application>
**************************************************************************

HTH

Spike

On 10/18/05, Greg Johnson <[EMAIL PROTECTED]> wrote:

Ok, I can get the basic popup window fine.  Hand to scratch the old
popupwindow code I had gotten from cflex.net because it was throwing
tons of errors in Flex 2.  Thing is, I can't figure out how to set a
text field in the popup when it's called.





------------------------ Yahoo! Groups Sponsor --------------------~-->
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/








--
--------------------------------------------
Stephen Milligan
Do you do the Badger?
http://www.yellowbadger.com

Do you cfeclipse? http://www.cfeclipse.org




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to