我正在设计一个 flex 页面,我有一个图像。当用户将鼠标悬停在图像上时,应显示特定文本。这是我编写的 actionScript 代码,但它不起作用(它没有在 mouseOver 事件上显示文本:(
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="100" minHeight="100">
<fx:Script>
private var helpText:String = "Some Text."
private function helpIconEvent(e:MouseEvent):void{
if(e.type == "mouseOver"){
e.currentTarget.helpText.visible = true;
}
}
private function addEventToHelpIcon():void {
helpIcon.addEventListener(MouseEvent.MOUSE_OVER, helpIconEvent);
}
</fx:Script>
<mx:Image id="helpIcon" x="270" y="187" width="50" height="50" mouseOver="addEventToHelpIcon"
source="source_path"/>
任何帮助/见解将不胜感激。
谢谢。