You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "jerome billet (JIRA)" <ji...@apache.org> on 2014/10/06 11:49:33 UTC

[jira] [Commented] (FLEX-34355) ActiveWindowManager, findHighestModalForm issue

    [ https://issues.apache.org/jira/browse/FLEX-34355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14160144#comment-14160144 ] 

jerome billet commented on FLEX-34355:
--------------------------------------

To reproduce it:

{code}

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx"  minWidth="955" minHeight="600">
	
	<fx:Script>
		<![CDATA[
			import mx.events.CloseEvent;
			import mx.managers.PopUpManager;
			
			import spark.components.TitleWindow;
			
			private var _popup1:TitleWindow;
			private var _popup2:TitleWindow;
			private var _popup3:TitleWindow;
			
			protected function button1_clickHandler(event:MouseEvent):void
			{
				if(_popup1==null){
					_popup1= new TitleWindow();
					_popup1.addEventListener(CloseEvent.CLOSE,_popup1CloseHandler,false,0,true);
					_popup1.title="test 1";
					PopUpManager.addPopUp(_popup1, this,true);
					_popup1.x=10;
					_popup1.y=10;
				}
				
							
				createPopup2(_popup1);	
				
				
				if(_popup2==null){
					_popup2= new TitleWindow();
					_popup2.addEventListener(CloseEvent.CLOSE,_popup2CloseHandler,false,0,true);
					_popup2.title="test 2";
					PopUpManager.addPopUp(_popup2, this,true);
					_popup2.x=50;
					_popup2.y=50;
				}
				
				
				createPopup2(_popup2);	
				
			}
			

			
			protected function createPopup2(parent:DisplayObject):void
			{

				if(_popup3==null){
					_popup3= new TitleWindow();
					_popup3.title="test 3";
				}
				PopUpManager.addPopUp(_popup3, parent, false);
				_popup1.x=parent.x+20;
				_popup1.y==parent.y+20;
				
			}
			
			
			private function _popup1CloseHandler(event:CloseEvent):void
			{
				
				PopUpManager.removePopUp(_popup1);			
				PopUpManager.removePopUp(_popup3);
				
				_popup1=null;
			}
			
			private function _popup2CloseHandler(event:CloseEvent):void
			{
				
				PopUpManager.removePopUp(_popup2);			
				PopUpManager.removePopUp(_popup3);
				
				_popup2=null;
			}
		]]>
	</fx:Script>
	
	<s:layout>
		<s:VerticalLayout/>
	</s:layout>
	<s:Button label="open" click="button1_clickHandler(event)"/>
	
	<s:TextInput />
	
</s:Application>


{code}

> ActiveWindowManager, findHighestModalForm issue
> -----------------------------------------------
>
>                 Key: FLEX-34355
>                 URL: https://issues.apache.org/jira/browse/FLEX-34355
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: .Unspecified - Framework
>    Affects Versions: Apache Flex 4.12.0
>            Reporter: Alexander Mazuruk
>
> We have a lot of modal messageBoxes popped out on the stage, and we are trying to close them one by one, and for the second closed dialog we are facing this issue. Modal form was removed from the stage faster than mouseClickhandler from SystemManager was called actually.
> IChildList interface has .contains() method, Why in the world you are not using it?
> This code fragment must be fixed:
> 	private function findHighestModalForm():int
> 	{
> /////////////////////////////////////////
> 				var index:int = rc.getChildIndex(f as DisplayObject);
> 				if (index > 0)
> 				{
> 				}
> /////////////////////////////////////////
> 	}
> As follows:
> 	private function findHighestModalForm():int
> 	{
> /////////////////////////////////////////
> 	var index:int = rc.contains(f as DisplayObject) ? rc.getChildIndex(f as DisplayObject) : -1;
> 				if (index > 0)
> 				{
> 				}
> /////////////////////////////////////////
> 	}
> Otherwise we have this error pops out when we don't have a child in the IChildList and code is trying to fetch it out, but it's not there already.
> ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
> 	at flash.display::DisplayObjectContainer/getChildIndex()
> 	at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::rawChildren_getChildIndex()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/managers/SystemManager.as:2195]
> 	at mx.managers::SystemRawChildrenList/getChildIndex()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/managers/SystemRawChildrenList.as:189]
> 	at mx.managers.systemClasses::ActiveWindowManager/findHighestModalForm()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/managers/systemClasses/ActiveWindowManager.as:441]
> 	at mx.managers.systemClasses::ActiveWindowManager/mouseDownHandler()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/managers/systemClasses/ActiveWindowManager.as:469]
> 	at flash.events::EventDispatcher/dispatchEventFunction()
> 	at flash.events::EventDispatcher/dispatchEvent()
> 	at mx.core::UIComponent/dispatchEvent()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/core/UIComponent.as:13682]
> 	at mx.managers::SystemManager/mouseEventHandler()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/managers/SystemManager.as:2926]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)