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

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

2012-09-21 
在用Flex做项目的时候,一些小经验第二问:ToggleButtonBar时鼠标怎么变手形?答:?useHandCursortrue第三

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


第二问: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的值。?

热点排行