首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 媒体动画 > flex >

flex兑现滑动显示隐藏效果

2012-10-30 
flex实现滑动显示隐藏效果??? mx:Script??????? ![CDATA[???import mx.controls.Alert??????private f

flex实现滑动显示隐藏效果

??? <mx:Script>
??????? <![CDATA[
???import mx.controls.Alert;
???
???private function init():void{
????img.y=0-(img.height*0.90);//初始默认将百分之九十的图片隐藏起来。通过y轴的福坐标来设置

???}
???
???//当鼠标覆盖的时候 将图片显示出来
??????????? private function moveMOverImage():void {
??????????????? myMove.end();
??????????????? myMove.yTo=0;
??????????????? myMove.play();
??????????? }
???????????
??????????? //鼠标移开的时候在将图片重新隐藏
??????????? private function moveMOutImage():void {
??????????????? myMove.end();
??????????????? myMove.yTo=0-(img.height*0.90);
??????????????? myMove.play();
??????????? }
???????????
???????????
????? ]]>
??? </mx:Script>

?

??? <mx:Move id="myMove" target="{img}"? />

?

??? <mx:Panel title="Move Effect Example" width="95%" height="95%"
??????? paddingTop="5" paddingLeft="10" paddingRight="10" paddingBottom="5">

?

??????? <mx:Canvas id="canvas" width="100%" height="100%" >

??????????? <mx:Image id="img" source="@Embed(source='beijing.png')"?? mouseOver="moveMOverImage();" mouseOut="moveMOutImage();" />

??????? </mx:Canvas>
???
??? </mx:Panel>
</mx:Application>

热点排行