如何在Flex标签中写事件函数

时间:2023-03-10 07:21:59
如何在Flex标签中写事件函数

在事件变量值中直接写函数语句,如果是多条语句,则用“;”号隔开。

示例如下:

<mx:Box id="label" backgroundColor="{outColor}" width="{labelWidth}" height="{labelHeight}"
                horizontalAlign="center" verticalAlign="middle"
                buttonMode="true" mouseOver="label.setStyle('backgroundColor',overColor)"
                mouseOut="label.setStyle('backgroundColor',outColor)">
            <s:Label id="plotButton" text="{plotLabel}" click="button1_clickHandler(event)"/>
        </mx:Box>