flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcl...@apache.org
Subject git commit: [flex-sdk] [refs/heads/develop] - FLEX-27648 Stop RTE and correct as per IList interface
Date Tue, 20 Aug 2013 03:05:12 GMT
Updated Branches:
  refs/heads/develop 03759d771 -> 8c2658ac2


FLEX-27648 Stop RTE and correct as per IList interface


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/8c2658ac
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/8c2658ac
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/8c2658ac

Branch: refs/heads/develop
Commit: 8c2658ac2f6fada57425913fad5bee74305c9f1c
Parents: 03759d7
Author: Justin Mclean <jmclean@apache.org>
Authored: Tue Aug 20 13:04:27 2013 +1000
Committer: Justin Mclean <jmclean@apache.org>
Committed: Tue Aug 20 13:04:27 2013 +1000

----------------------------------------------------------------------
 .../projects/mx/src/mx/containers/ViewStack.as       | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/8c2658ac/frameworks/projects/mx/src/mx/containers/ViewStack.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/mx/src/mx/containers/ViewStack.as b/frameworks/projects/mx/src/mx/containers/ViewStack.as
index bf462ca..2fc507e 100644
--- a/frameworks/projects/mx/src/mx/containers/ViewStack.as
+++ b/frameworks/projects/mx/src/mx/containers/ViewStack.as
@@ -1581,8 +1581,21 @@ public class ViewStack extends Container implements IHistoryManagerClient,
ISele
      */
     public function getItemIndex(item:Object):int
     {
-        return getChildIndex(item as DisplayObject);
+		if (isValidChild(item as DisplayObject))
+        	return getChildIndex(item as DisplayObject);
+		else
+			return -1;
     }
+	
+	private function isValidChild(child:DisplayObject):Boolean {
+		for (var i:int = 0; i < numChildren; i++)
+		{
+			if (getChildAt(i) == child)
+				return true;
+		}
+		
+		return false;
+	}
 
     /**
      *  @private


Mime
View raw message