Sounds like a good plan. See you manana mi amigo. -----Original Message----- From: "Kevin" <[EMAIL PROTECTED]> To: [email protected] Sent: 3/21/07 2:33 PM Subject: Re: [flexcoders] PopUp Returning NULL
I think I figured it out. Because I am using the Cairngorm Model Locator pattern to control the popup state (thus the ObserveValue class) I need to be very strict about not trying to call popups directly. In this case, when I called the popup via a direct function call, I was not updating the model and thus there was a NULL value on the model that would have otherwise been set. When the popup opened from a direct call, it saw this NULL value and thew an error. My mistake....I need to stick with my pattern for better or for worse It is so tempting to take short cuts though! Thanks for the help though. - kevin On Mar 21, 2007, at 2:14 PM, Kevin wrote: > > I am not using modules and I also tried to comment out the > ObserveValue tag to see that was causing a problem. Here is the > error message. I am not sure how to read these things to help me! > > Thanks, Kevin > > TypeError: Error #1009: Cannot access a property or method of a > null object reference. > at mx.managers::PopUpManagerImpl/::findPopupInfoByOwner() > at mx.managers::PopUpManagerImpl/removePopUp() > at mx.managers::PopUpManager$/removePopUp() > at com.onefoot.dbocl.view.admin::WinChangePassword/::closePopUp() > at Function/http://adobe.com/AS3/2006/builtin::call() > at com.adobe.ac::ObserveValue/ > com.adobe.ac:ObserveValue::callHandler() > at com.adobe.ac::ObserveValue/set handler() > at MethodInfo-1976() > at Function/http://adobe.com/AS3/2006/builtin::call() > at mx.binding::Binding/::innerExecute() > at Function/http://adobe.com/AS3/2006/builtin::apply() > at mx.binding::Binding/mx.binding:Binding::wrapFunctionCall() > at mx.binding::Binding/execute() > at _com_onefoot_dbocl_view_admin_WinChangePasswordWatcherSetupUtil/ > setup() > at com.onefoot.dbocl.view.admin::WinChangePassword/initialize() > at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/ > internal::childAdded() > at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/ > internal::rawChildren_addChildAt() > at mx.managers::SystemManager/addChild() > at mx.managers::PopUpManagerImpl/addPopUp() > at mx.managers::PopUpManagerImpl/createPopUp() > at mx.managers::PopUpManager$/createPopUp() > at dboclhome/::changePassword() > at dboclhome/__chpw_click() > > > On Mar 21, 2007, at 2:02 PM, Alex Harui wrote: > >> >> Are these things in modules? If so, you might have the shared >> code problem. WhatÂ’s the full text of the error? >> >> >> >> From: [email protected] >> [mailto:[EMAIL PROTECTED] On Behalf Of Kevin >> Sent: Wednesday, March 21, 2007 10:06 AM >> To: [email protected] >> Subject: [flexcoders] PopUp Returning NULL >> >> >> >> I am having some trouble with a popup window. Here is the popup >> code: >> >> >> >> private function changePassword() : void >> >> { >> >> var pwWindow:IFlexDisplayObject = PopUpManager.createPopUp >> (this, WinChangePassword, true); >> >> } >> >> >> >> if I call it from a Link Button I get a "Can't Access Property of >> Null Object"... error. >> >> >> >> <mx:LinkButton id="chpw" label="change pw" click="changePassword >> ();"/> >> >> >> >> However, when I call it from the ObserveValue Component I am >> using, it works fine. >> >> >> >> <ac:ObserveValue id="pwchange" source="{model.changePw}" >> value="{1}" handler="{changePassword}" /> >> >> >> >> Also, when i check the debugger in both cases it shows pwWindow = >> null. (I am not sure what it is supposed to be.) >> >> >> >> Thanks for the suggestions. >> >> >> >> - Kevin >> >> > > >

