问题
I am working through an example for creating Arc and Wedge shapes in Flex that use the Path component to draw the stroke and fill.
http://hansmuller-flex.blogspot.com/2011/10/more-about-approximating-circular-arcs.html#comment-form
I was looking to add a click event to the Arc/Wedge, but a Path cannot have a Click event (or really any other events as its a primitive variable I think).
Is there a workaround do you think?
回答1:
Answering my own question:
I added the Path to a Group, set the group width and height to 100%, and set the mouseEnabledWhereTransparent="false" for the group. When I move over the filled path elements (there are many of these groups layered on top of one another), the mouseEvents for the correct Group's get fired.
来源:https://stackoverflow.com/questions/9117056/flex-path-capturing-click-event