<?xml version="1.0" encoding="utf-8"?> <!--created:Oct 6, 2010 file:FLEX4EffectExample1.mxml author:Michael --> <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" backgroundColor="0" xmlns:comp="comp.*" viewSourceURL="srcview/index.html"> <s:layout> <s:VerticalLayout verticalAlign="middle" horizontalAlign="center"/> </s:layout> <fx:Declarations> <s:Animate id="myAnimate" duration="800" easer="{this.linearEasing}"> <s:SimpleMotionPath property="height" valueFrom="0" valueTo="50"/> </s:Animate> <s:Animate id="myAnimate1" duration="600" easer="{this.linearEasing}"> <s:SimpleMotionPath property="height" valueFrom="50" valueTo="0"/> </s:Animate> <s:Linear id="linearEasing" easeInFraction="0" easeOutFraction="1"/> </fx:Declarations> <fx:Script> <![CDATA[ import mx.events.FlexEvent; private var cover:spark.components.Label; private var cover1:spark.components.Label; protected function bordercontainer1_creationCompleteHandler(event:FlexEvent):void { cover=new spark.components.Label(); cover1=new spark.components.Label(); cover.top=0; cover.left=0; cover.right=0; cover.setStyle("backgroundColor", 0); cover.setStyle("backgroundAlpha", .4); cover.setStyle("textAlign", "center"); cover.setStyle("paddingTop", 15); cover.setStyle("fontSize", 30); cover.setStyle("fontStyle", "italic"); cover.setStyle("color", "white"); cover.text="Cosmos lighting"; cover.setStyle("addedEffect", myAnimate); cover.setStyle("removedEffect", myAnimate1); cover1.bottom=0; cover1.left=0; cover1.right=0; cover1.setStyle("backgroundColor", 0); cover1.setStyle("backgroundAlpha", .4); cover1.setStyle("textAlign", "center"); cover1.setStyle("paddingTop", 15); cover1.setStyle("fontSize", 16); cover1.setStyle("fontFamily", "Arial"); cover1.setStyle("color", "white"); cover1.text="http://www.sxc.hu/"; cover1.buttonMode=true; cover1.addEventListener(MouseEvent.CLICK, onClick); cover1.setStyle("addedEffect", myAnimate); cover1.setStyle("removedEffect", myAnimate1); this.bc.addEventListener(MouseEvent.ROLL_OVER, onOver); this.bc.addEventListener(MouseEvent.ROLL_OUT, onOut); } private function onOver(e:MouseEvent):void { this.myAnimate1.end(); this.bc.addElement(cover); this.bc.addElement(cover1); } private function onOut(e:MouseEvent):void { this.myAnimate.end(); this.bc.removeElement(cover); this.bc.removeElement(cover1); } private function onClick(e:MouseEvent):void { navigateToURL(new URLRequest(e.target.text), "_blank"); } ]]> </fx:Script> <s:BorderContainer backgroundImage="@Embed('images/images.png')" backgroundImageFillMode="clip" id="bc" width="400" height="296" cornerRadius="4" creationComplete="bordercontainer1_creationCompleteHandler(event)"> </s:BorderContainer> </s:Application>?
详细解决方案
Mouse Rollover成效-显示自定义控件 (第一层)
热度:277 发布时间:2012-10-18 13:46:55.0
相关解决方案
- 在Gridview上实现on mouse over,解决方法
- 请用代码演示语法功能:SET CENTURY TO 世纪值 ROLLOVER 年份参照值,该怎么处理
- Mouse Rollover成效-显示自定义控件 (第一层)
- Exception in thread "main" java.io.FileNotFoundException: mouse.txt 。该怎么处理
- QGraphicsItem:ungrabMouse: cannot ungrab mouse without scene解决思路
- windows xp下怎么分別讀取4只PID,VID都相同的USB Mouse
- 【数论】Codeforces1027G X-mouse in the Campus
- NYOJ - 824 - Greedy Mouse(贪心算法--部分背包问题)
- OpenCV-Python官方文档中文翻译8:Mouse as a Paint-Brush鼠标作为画笔
- 《OpenCV》? Mouse as a Paint-Brush (鼠标事件)
- HDLBits 系列(29)PS/2 mouse protocol(PS/2 packet parser and datapath)
- HDLBits 系列(28)PS/2 mouse protocol(PS/2 packet parser)
- hdu 1160 fat mouse speed
- verilog实现鼠标协议PS/2 mouse protocol
- 虚拟化KVM的使用 - mouse without borders
- D. Mouse Hunt -codeforces -csdn博客
- jQuery-UI mouse.js源码解读
- Javascript Mouse event
- CF1027D Mouse Hunt(topo总结)