修改flash cs4组件tileList的样式

本文介绍如何使用Flash的TileList组件,并通过设置TextFormat样式来调整列表中项目的字体大小、颜色等属性,同时展示了如何加载图片资源。

以前多用flex的组件进行开发,今天用到了flash 中的组件,由于默认的样式并不能让我满意
特别是中文字小于12px,就十分模糊看不清楚了
所以需要对flash中的组件的样式进行修改

package   

{   
    import flash.display.Sprite;   
    import fl.controls.TileList;   
    import fl.controls.ScrollBarDirection;   
    import flash.text.TextFormat;   
 
    public class TileListDemo extends Sprite   
    {   
        private var tlc:TileList;   
 
        public function TileListDemo()   
        {   
            // create TileList instance   
            var tlc:TileList = new TileList();   
 
            // create TextFormat object to style labels   
            var tf:TextFormat = new TextFormat();   
            tf.font = "Verdana";   
            tf.bold = true;   
            tf.color = 0xFF6666;   
            tf.size = 14;   
 
            // add content to the TileList   
            tlc.addItem({label:"Image 1", source:"http://manewc.com/projects/flash/TileList/1.jpg"});   
            tlc.addItem({label:"Image 2", source:"http://manewc.com/projects/flash/TileList/2.jpg"});   
            tlc.addItem({label:"Image 3", source:"http://manewc.com/projects/flash/TileList/3.jpg"});   
            tlc.addItem({label:"Image 4", source:"http://manewc.com/projects/flash/TileList/4.jpg"});   
            tlc.addItem({label:"Image 5", source:"http://manewc.com/projects/flash/TileList/5.jpg"});   
            tlc.addItem({label:"Image 6", source:"http://manewc.com/projects/flash/TileList/6.jpg"});   
 
            // set column and row values   
            tlc.columnWidth = 500;   
            tlc.rowHeight = 300;   
            tlc.columnCount = 1;   
            tlc.rowCount = 1;   
            tlc.height = 320;   
            tlc.width = 500;   
 
            // enable scrolling   
            tlc.scrollPolicy = "on";   
 
            // position   
            tlc.move(stage.stageWidth/2 - tlc.width / 2,stage.stageHeight/2 - tlc.height/2);   
 
            // add to the display   
            addChild(tlc);    
 
            // set style for labels   
            tlc.setRendererStyle("textFormat", tf);   
            tlc.setRendererStyle("imagePadding", 5);   

        }   
    }   

转载于:https://www.cnblogs.com/xxcainiao/archive/2009/05/06/1450426.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值