I’m new to flex, and using a small open-source UI library ReCoral. In my test, I use its Application class as the root of mxml, and which has a click handler.
<?xml version="1.0" encoding="utf-8"?>
<common:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:common="geb.common.*" width="500" height="500"
xmlns:controls="geb.controls.*"
xmlns:mx="library://ns.adobe.com/flex/mx"
click="hello()">
<fx:Script>
<![CDATA[
private function hello(): void {
trace("world");
}
]]>
</fx:Script>
<controls:Label text="Click Me" height="100" width="100" click="hello()" />
</common:Application>
You can see the code is quite simple.
But when I click the Label, or the Application, the hello() method seems never invoked. I tried to add a breakpoint on the trace("world") line in debug mode, it had never been triggered.
Since the author is quite busy, and I’m new to flex, I don’t know how to debug this problem.
- Is there any way to listen any click event, and log the information?
- Is there any useful document I should read?
I found the reason, that
Labelin RedCoral setmouseEnabledtofalseininitedmethod:See: https://github.com/xiaotie/RedCoral/blob/master/src/geb/controls/Label.as#L112
So we should enable it: