Author: aharui
Date: Sun Nov 25 07:14:55 2012
New Revision: 1413296
URL: http://svn.apache.org/viewvc?rev=1413296&view=rev
Log:
Fix AIR hit detection
Modified:
incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as
Modified:
incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as
URL:
http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as?rev=1413296&r1=1413295&r2=1413296&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as
(original)
+++ incubator/flex/sdk/branches/develop/mustella/as3/src/mustella/UnitTester.as
Sun Nov 25 07:14:55 2012
@@ -601,6 +601,26 @@ public class UnitTester extends EventDis
root = _root;
}
}
+ else if (root != _root && (root is Stage))
+ {
+ // seems to happen in AIR windows
+ root = target;
+ try
+ {
+ // Walk up as high as you can get
+ while (!(root.parent is Stage))
+ {
+ root = root.parent;
+ }
+ }
+ catch (e:Error)
+ {
+ // in another sandbox, start from our root.
+ // probably won't work in an AIR window with
+ // loaded content.
+ root = _root;
+ }
+ }
_getObjectsUnderPoint(root, pt, arr);
return arr;