You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2013/08/20 05:05:12 UTC
git commit: [flex-sdk] [refs/heads/develop] - FLEX-27648 Stop RTE and
correct as per IList interface
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 <jm...@apache.org>
Authored: Tue Aug 20 13:04:27 2013 +1000
Committer: Justin Mclean <jm...@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