corbo950
07-23-2008, 12:20 AM
im trying to make the popup resize if the browser is resized i get an error but then if i click continue it works. the error says
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.managers::PopUpManagerImpl/findPopupInfoByOwner()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ managers\PopUpManagerImpl.as:657]
at mx.managers::PopUpManagerImpl/centerPopUp()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ managers\PopUpManagerImpl.as:341]
at mx.managers::PopUpManager$/centerPopUp()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ managers\PopUpManager.as:184]
at open_swim/onResize()[C:\Documents and Settings\Administrator\My Documents\Flex Builder 3\Open Swim\src\open_swim.mxml:52]
at open_swim/___open_swim_Application1_resize()[C:\Documents and Settings\Administrator\My Documents\Flex Builder 3\Open Swim\src\open_swim.mxml:18]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ core\UIComponent.as:9051]
at mx.core::UIComponent/dispatchResizeEvent()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ core\UIComponent.as:6912]
at mx.core::UIComponent/setActualSize()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ core\UIComponent.as:6541]
at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ managers\SystemManager.as:2456]
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ managers\SystemManager.as:2330]
here is my code:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*"
creationComplete="applicationStart();" resize="onResize(event)">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.events.ResizeEvent;
public var loginPopUp:login = new login();
private function applicationStart():void
{
PopUpManager.addPopUp(loginPopUp, this, true),
PopUpManager.centerPopUp(loginPopUp);
}
private function onResize(event:Event):void
{
if(loginPopUp)
{
PopUpManager.centerPopUp(loginPopUp);
}
}
]]>
</mx:Script>
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.managers::PopUpManagerImpl/findPopupInfoByOwner()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ managers\PopUpManagerImpl.as:657]
at mx.managers::PopUpManagerImpl/centerPopUp()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ managers\PopUpManagerImpl.as:341]
at mx.managers::PopUpManager$/centerPopUp()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ managers\PopUpManager.as:184]
at open_swim/onResize()[C:\Documents and Settings\Administrator\My Documents\Flex Builder 3\Open Swim\src\open_swim.mxml:52]
at open_swim/___open_swim_Application1_resize()[C:\Documents and Settings\Administrator\My Documents\Flex Builder 3\Open Swim\src\open_swim.mxml:18]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ core\UIComponent.as:9051]
at mx.core::UIComponent/dispatchResizeEvent()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ core\UIComponent.as:6912]
at mx.core::UIComponent/setActualSize()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ core\UIComponent.as:6541]
at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ managers\SystemManager.as:2456]
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ managers\SystemManager.as:2330]
here is my code:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*"
creationComplete="applicationStart();" resize="onResize(event)">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.events.ResizeEvent;
public var loginPopUp:login = new login();
private function applicationStart():void
{
PopUpManager.addPopUp(loginPopUp, this, true),
PopUpManager.centerPopUp(loginPopUp);
}
private function onResize(event:Event):void
{
if(loginPopUp)
{
PopUpManager.centerPopUp(loginPopUp);
}
}
]]>
</mx:Script>