修改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);
}
}
}
特别是中文字小于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);
}
}
}
相关文章推荐
- 修改原生单选框样式(vue单选组件)
- vue里面父组件修改子组件样式的方法
- 使用TileList+TitleWindow组件开发聊天表情功能
- 修改ASP.NET MVC Ajax分页组件ASP.NET MvcPager一个小Bug并修该样式为自己所用(三)
- FLASH修改组件skin的方法
- <小程序>修改button组件的样式
- vue组件中的样式属性:scoped,解决在父组件中无法修改子组件样式问题
- vue中修改子组件样式
- Vue修改组件样式问题
- vue中element组件样式修改无效
- vue里面父组件如何修改子组件样式
- 只修改input file组件的浏览按钮样式
- List组件、UILoader类、TileList组件的相关运用
- 使用TileList+TitleWindow组件开发聊天表情功能
- 在Vue.js中,在scoped模式下如何修改子组件内部标签的样式
- CSS list-style修改列表属性控制li标签样式
- [Android UI]基础组件的学习——ToggleButton的使用及样式修改
- FlashSwing教你如何修改组件的外观
- flash 8组件篇:list组件
- 使用selector来修改安卓自带组件的样式