繁体   English   中英

Flex,图像交换鼠标悬停和状态更改点击

[英]Flex, image swap on mouse-over and state change on-click

我正在学习Flex并且想要在鼠标悬停时更改图像,并在点击时切换到另一个状态。 我不想使用Flex中提供的任何按钮。 有没有人知道实现我想要的代码? 谢谢

尝试这样的事情:

<fx:Declarations>
  <s:BitmapImage id="imageOut" source="@Embed('images/button.png')" />
  <s:BitmapImage id="imageOver" source="@Embed('images/button-over.png')" />
</fx:Declarations>

<s:Image id="imageButton" source="{imageOut.source}"
         rollOver="imageButton.source = imageOver.source"
         rollOut="imageButton.source = imageOut.source"
         click="someObject.currentState = 'someState'"/>

我不明白你的意思是改变图像上的状态还是别的东西,但不管怎样,这应该可以让我们了解它是如何完成的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM