Flex事件处理
刚弄FLEX,我想实现在一个图片上鼠标移上去的时候图片上移一定的位置,鼠标移出以后又加到原来的位置,现我准备了一个100PX*100PX的图片,我的代码如下,
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ import mx.controls.Image; internal function mouseover(evt:MouseEvent):void { var nowimg:Image=Image(evt.currentTarget) ; nowimg.y-=100; } internal function mouseout(evt:MouseEvent):void{ var nowimg:Image=Image(evt.currentTarget) ; nowimg.y+=100; } ]]> </mx:Script> <mx:Image x="34" y="110" mouseOver="mouseover(event)" mouseOut="mouseout(event)" source="../images/honda.gif" width="100"/> </mx:Application>