在用Flex做项目的时候,一些小经验

http://hi.baidu.com/intercessor/blog/item/9584d84457bfbb41500ffe69.html
intercessor 写道
第一问: 如何在FLEX中做竖式导航?

答: <mx:ButtonBar direction="vertical" > </mx:ButtonBar>

 direction="horizontal" 横          direction="vertical" 竖

第二问:ToggleButtonBar时鼠标怎么变手形?

答: useHandCursor="true"

第三问:如何做一个矩形二个角圆二个角方?

答:CustomBorder.as
package
{

import mx.skins.RectangularBorder;
import flash.display.Graphics;
import mx.graphics.RectangularDropShadow;

public class CustomBorder extends RectangularBorder
{

private var dropShadow:RectangularDropShadow;

override protected function updateDisplayList
(unscaledWidth:Number, unscaledHeight:Number):void
{

super.updateDisplayList(unscaledWidth, unscaledHeight);
var cornerRadius:Number = getStyle("cornerRadius");
var backgroundColor:int = getStyle("backgroundColor");
var backgroundAlpha:Number = getStyle("backgroundAlpha");
graphics.clear();

// Background

            drawRoundRect
(
0, 0, unscaledWidth, unscaledHeight,
{tl: 0, tr:0, bl: cornerRadius, br:  cornerRadius},
backgroundColor, backgroundAlpha
);

// Shadow

            if (!dropShadow)
dropShadow = new RectangularDropShadow();

dropShadow.distance = 8;
dropShadow.angle = 45;
dropShadow.color = 0;
dropShadow.alpha = 0.4;
dropShadow.tlRadius = 0;
dropShadow.trRadius = 0;
dropShadow.blRadius = cornerRadius;
dropShadow.brRadius = cornerRadius;

dropShadow.drawShadow(graphics, 0, 0, unscaledWidth, unscaledHeight);
}

}
}

        borderSkin="CustomBorder"   MXML文件中这样

第三问:关于一些朋友问到如何通过CSS平铺背景.

答:background-image: Embed("图形", scaleGridTop="1", scaleGridBottom="2", scaleGridLeft="3", scaleGridRight="4");
backgroundSize:"100%";
注意:TOP>BOTTOM    LEFT>RIGHT
通过这个就可以实现各种需要的背景。微妙之处就在于如果针对图形设置top bottom left right的值。
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值