您的位置:首页 > Web前端 > CSS

修改flash cs4组件tileList的样式

2009-05-06 09:42 363 查看
以前多用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);


}

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: