论坛首页 编程语言技术论坛

FLEX展示---------炫不炫你说了算(源码共享)

浏览 4317 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2008-07-11  

前面朋友希望看下源码,其实昨天是打算一起上传的,但JAVAEYE好像在浏览器的兼容性上还有较多问题,上传一直不成功.今天贴出来给大家看下,如果大家要完整的,可以加我QQ:262482485,还是说下代码结构吧,

 

主应用是少不了的.先贴出来吧:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="black" xmlns:com="com.*">
		<com:RelectBattonBar/>
</mx:Application>

 

当然不只有这么少的代码了,我作成了组件了,来看看RElectBattonBar.mxml(写错了字,大家见谅,Button)

 

<?xml version="1.0" encoding="utf-8"?>
<mx:VBox 
	xmlns:mx="http://www.adobe.com/2006/mxml" 
	xmlns:reflector="com.rictus.reflector.*"
	xmlns:dragpanel="com.rictus.dragpanel.*"
	xmlns:com="com.*" 
	borderStyle="solid" borderColor="#333333" borderThickness="1" verticalGap="0"
		width="700" height="530" horizontalAlign="center" cornerRadius="10"
	    verticalAlign="middle" backgroundColor="#070707">
	    <mx:Spacer height="140"/>
	    <dragpanel:DragPanel id="buttonsBar" width="100%" height="130" borderStyle="none" verticalGap="0" backgroundColor="black">
	    	<mx:HBox width="100%" height="100%" verticalAlign="middle" horizontalAlign="center">
	    	<com:MyButton label="登陆"/>
			<com:MyButton label="注册"/>
			<com:MyButton label="查询"/>
			<com:MyButton label="转账"/>
			<com:MyButton label="改密"/>
			<com:MyButton label="投诉"/>
			<com:MyButton label="帮助"/>
		    </mx:HBox>
	    </dragpanel:DragPanel>
		<reflector:Reflector id="myReflector" target="{buttonsBar}"  alpha=".6" falloff="0.33" blurAmount="0.27"/>
</mx:VBox>

 

 

还没有完,还有一个我自定义的MyButton.mxml

 

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Button xmlns:mx="http://www.adobe.com/2006/mxml" icon="{btnIcon}" 
	  labelPlacement="bottom" color="black" styleName="MyButton"
	  rollOverEffect="{bigZm}" rollOutEffect="{smallZm}"
	  scaleX=".9" scaleY=".9" width="90" height="90" fontSize="13" cornerRadius="10">
	<mx:Style>
		.MyButton {
   					fillAlphas: 0.18, 0.77, 0.27, 0.76 ;
   					fillColors: #cccccc, #990000, #cccccc, #000000;
  					color: #ffffff;
   					textRollOverColor: #ffffff;
    				/* themeColor: #990000; */
    				themeColor: #009dff;
					}
	</mx:Style>
	<mx:Script>
		<![CDATA[
			[Bindable]
			[Embed(source="login.png")]
			public var btnIcon:Class;
			
		]]>
	</mx:Script>
	<mx:Parallel id="bigZm">
		<mx:Zoom zoomHeightFrom=".9" zoomHeightTo="1" zoomWidthFrom=".9" zoomWidthTo="1" duration="300"/>
		<mx:Glow alphaFrom="1.0" color="#ffffff"  alphaTo=".3" blurXFrom="0" blurXTo="30" blurYFrom="0" blurYTo="30" duration="300"/>
	</mx:Parallel>
	<mx:Parallel id="smallZm">
		<mx:Zoom id="bigZoom" zoomHeightFrom="1" zoomHeightTo=".9" zoomWidthFrom="1" zoomWidthTo=".9" duration="300"/>
		<mx:Glow alphaFrom=".3"  color="#000000"  alphaTo="1" blurXFrom="30" blurXTo="0" blurYFrom="30" blurYTo="0" duration="2000"/>
	</mx:Parallel>
</mx:Button>

 

 

另外,提醒一下, 我用到了一个倒影效果的包,大家可以到网上下载Reflector ,源代码就这么多,其实也不算多吧.

   发表时间:2008-07-31  
让我们怎么回答你呢 ? 你说炫不炫啊 ? 没的图  看什么啊 
1 请登录后投票
论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics