好贷网好贷款

类似百度添加或删除收藏的效果

发布时间:2016-12-5 18:28:46 编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"类似百度添加或删除收藏的效果",主要涉及到类似百度添加或删除收藏的效果方面的内容,对于类似百度添加或删除收藏的效果感兴趣的同学可以参考一下。

  类似ToolTip组件: FavoritesToolTipComp.mxml <s:SkinnableContainer...> <s:Group left="0" right="0" top="0" bottom="0"> <s:Rect width="100%" height="100%"> <s:fill> <s:SolidColor color="#FFFECC" /> </s:fill> <s:stroke> <s:SolidColorStroke color="#DFB259" weight="1" caps="round" joints="round" /> </s:stroke> </s:Rect> <s:Label id="favorLabel" left="5" right="5" top="10" bottom="10" fontFamily="宋体" fontSize="12" color="#990000" /> </s:Group> <s:Path winding="nonZero" horizontalCenter="0" top="-3.7" data="M0 3.6665 4.16699 3.6665 7.83398 0 11.834 3.6665 16.834 3.6665"> <s:fill> <s:SolidColor color="#FFFECC"/> </s:fill> <s:stroke> <s:SolidColorStroke weight="1" caps="none" joints="miter" miterLimit="10" color="#DFB259"/> </s:stroke> </s:Path> </s:SkinnableContainer> 主程序调用FavoritesToolTipComp组件 <s:Application xmlns:component="component.*" ... > <fx:Script> <![CDATA[ import component.FavoritesToolTipComp; import flash.utils.Timer; import mx.core.FlexGlobals; protected function button1_clickHandler(event:MouseEvent):void { var favorToolTip:FavoritesToolTipComp=new FavoritesToolTipComp(); FlexGlobals.topLevelApplication.addElement(favorToolTip); favorToolTip.left=10; favorToolTip.top=100; var favorTime:Timer=new Timer(5000,1); if(favorBtn.selected==true){ favorToolTip.visible=favorToolTip.includeInLayout=true; favorToolTip.favorLabel.text="成功添加到收藏夹"; favorTime.addEventListener(TimerEvent.TIMER,function():void{ favorToolTip.visible=favorToolTip.includeInLayout=false; }); favorTime.start(); } else{ favorToolTip.visible=favorToolTip.includeInLayout=true; favorToolTip.favorLabel.text="已从收藏夹中删除"; favorTime.addEventListener(TimerEvent.TIMER,function():void{ favorToolTip.visible=favorToolTip.includeInLayout=false; }); favorTime.start(); } } ]]> </fx:Script> <s:ToggleButton id="favorBtn" label="添加" click="button1_clickHandler(event)" /> </s:Application>  

上一篇:Android二维码功能实现,在程序内嵌入ZXing项目
下一篇:HDU 1754 I Hate It

相关文章

相关评论