In the end I solved it by just writing my own code using the example 
in Flex2 Sample Explorer.  Thing is every example of sending data to 
a popup I have found usually instead shows returning data :/

But I have a way I can easily send and recieve from a popup.

Here is the code im using.

This is the function that displays the popup.

import mx.managers.PopUpManager;
// Error Handler Function
public function err(message:String, title:String):Void {
  var errpop:MyPopup = MyPopup(PopUpManager.createPopUp(this, 
MyPopup, true));
  errpop.title = title;
  errpop.messagebox.htmlText = message;
}

And here is the Popup File

<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.macromedia.com/2005/mxml"; width="500" 
height="503"
borderStyle="outset" cornerRadius="10" backgroundColor="#800000" 
themeColor="#800000" title="Error" color="#FFFFFF" 
borderColor="#800000">
        <mx:Script>
                <![CDATA[
                        import mx.managers.PopUpManager;
                ]]>
        </mx:Script>
        <mx:TextArea id="messagebox" width="100%" height="100%" 
editable="false" text="error" backgroundColor="#FFDDDD" 
themeColor="#800000"/>
        <mx:HBox width="100%" horizontalAlign="center">
                <mx:Button label="Close" 
click="PopUpManager.removePopUp(this)"/>
        </mx:HBox>
</mx:Panel>

Key things to note in the popup function is that you are setting the 
type of the popup handle to the popup's name.  This little trick then 
lets you access anything in the popup:Variables, Functions, 
Components.  In theory if you defined the popup handle variable 
outside the function you could then be interactive if you made the 
window non-model.  I use model since I am using it to display error 
messages.
--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> 
wrote:
>
> If this was 1.5, I's say, call the removePopUp from a doLater().
> 
> Tracy
> 
> -----Original Message-----
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of Greg Johnson
> Sent: Wednesday, October 19, 2005 4:58 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Flex2: Popup Error
> 
> BTW Thanks to Spike, he gave me the little bits I needed to finally 
see 
> what I needed to "get it" with the changes in 2.
> 
> Now I have tried many variations of a popup window to send stuff 
too.  
> It works for the most part.  But when I close the window I get an 
error.
> 
> Here is the function that fires the popup window up.
> -------
>       import mx.managers.PopUpManager;
>       import mx.containers.TitleWindow;
>       // Error Handler Function
>       public function err(message:String, title:String):Void {
>               var errpop:TitleWindow = TitleWindow
> (PopUpManager.createPopUp(this, MyPopup, true));
>               errpop.title="Test";
>               errpop.closeButton=true;
>       }
> --------
> 
> And here is the MyPopup.mxml
> --------
> <?xml version="1.0" encoding="utf-8"?>
> <mx:TitleWindow xmlns:mx="http://www.macromedia.com/2005/mxml"; 
> click="PopUpManager.removePopUp(this)" width="940" height="503">
>       <mx:Script>
>               <![CDATA[
>                       import mx.managers.PopUpManager;
>               ]]>
>       </mx:Script>
>       <mx:TextArea id="messagebox" width="100%" height="100%" 
> editable="false" />
> </mx:TitleWindow>
> -------
> 
> And here is the error that gets thrown
> -------
> TypeError: Error #1009: null has no properties.
>       at mx.managers::PopUpManager$/removePopUp()
>       at MyPopup/___TitleWindow0_click()
> --------
> 
> 
> 
> 
> 
> 
> --
> 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
>






------------------------ 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/
 





Reply via email to