Hi Alex,
Thanks for taking the time. I'm not sure about the proper way to correct
this. I created a new JIRA item
(https://issues.apache.org/jira/browse/FLEX-33915). I have an idea for how
to fix it below that uses the same class type as that which was passed to
the function. I'm not sure if the manipulation of class type will result in
a compiler error, requiring the cancelableEvent to be an Object rather than
a MouseEvent. I'm unable to find info on building the framework with the
change.
BTW - I noted a documentation bug here as well because it says that it is
supposed to replace cancelable events but the code replaces events with
!e.cancelable (either it's a doc but or it's a functionality bug and the
documentation was the intended functionality).
Thanks again,
Mike
private function mouseEventHandler(e:MouseEvent):void
{
if (!e.cancelable && e.eventPhase != EventPhase.BUBBLING_PHASE)
{
e.stopImmediatePropagation();
var cancelableEvent:MouseEvent = null;
// use the class of the item that was passed in
var mouseEventClass:Class =
Class(getDefinitionByName(getQualifiedClassName(e));
if ("clickCount" in e)
{
// AIR MouseEvent. We need to use a constructor so we can
// pass in clickCount because it is a read-only property.
cancelableEvent = new mouseEventClass(e.type, e.bubbles, true,
e.localX,
e.localY, e.relatedObject, e.ctrlKey, e.altKey,
e.shiftKey, e.buttonDown, e.delta,
e["commandKey"], e["controlKey"], e["clickCount"]);
}
else
{
cancelableEvent = new mouseEventClass(e.type, e.bubbles, true,
e.localX,
e.localY, e.relatedObject, e.ctrlKey, e.altKey,
e.shiftKey, e.buttonDown, e.delta);
}
e.target.dispatchEvent(cancelableEvent);
}
}
--
View this message in context:
http://apache-flex-users.2333346.n4.nabble.com/Possible-bug-in-MouseEvent-handling-tp3804p3825.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.