I believe the removePopUp method is being
called twice… You will find if you click anywhere in the header of the
titlewindow, the window will fire the click event (Which is set to close the
window) and if you click on the close button, it fires the event twice. You
get the null error because the window has already closed by the time the second
remove method tries to execute. I did not find this, but I say someone else
mention this somewhere. Hope this helps
Dustin Mercer
From:
[email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt
Sent: Thursday, October 20, 2005
10:03 AM
To: [email protected]
Subject: RE: [flexcoders] Flex2:
Popup Error
If this was 1.5, I's say,
call the removePopUp from a doLater().
Tracy
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On
Behalf Of Greg Johnson
Sent: Wednesday, October 19, 2005 4:58 PM
To: [email protected]
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
--
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
|
- RE: [flexcoders] Flex2: Popup Error Mercer, Dustin
-