系统滚动条类TileList举例说明
2010-08-03 17:44
204 查看
import fl.controls.TileList; import fl.controls.ScrollBarDirection; var myTileList:TileList = new TileList(); myTileList.addItem({label:"Image 1", source:"http://www.helpexamples.com/flash/images/image1.jpg"}); myTileList.addItem({label:"Image 2", source:"http://www.helpexamples.com/flash/images/image2.jpg"}); myTileList.addItem({label:"Image 3", source:"http://www.helpexamples.com/flash/images/image3.jpg"}); myTileList.direction = ScrollBarDirection.VERTICAL; myTileList.columnWidth = 300;//列宽度,并非图片宽度 myTileList.rowHeight = 134;//每一行的高度 myTileList.columnCount = 1;//列数 myTileList.rowCount = 2;//显示的行数 myTileList.move(10, 10); addChild(myTileList);
import fl.data.DataProvider; import flash.display.DisplayObject; import fl.controls.TileList; var aTl:TileList = new TileList(); var aBoxes:Array = new Array(); var i:uint=0; var colors:Array=new Array(0x00000,0xFF0000,0x0000CC,0x00CC00,0xFFFF00); var colorNames:Array=new Array("Midnight","Cranberry","Sky","Forest","July"); var dp:DataProvider = new DataProvider(); for (i=0; i < colors.length; i++) { aBoxes[i] = new MovieClip(); drawBox(aBoxes[i], colors[i]); dp.addItem( {label:colorNames[i], source:aBoxes[i]} ); } aTl.dataProvider=dp; aTl.columnWidth=110;//单个图片的列的宽度 aTl.rowHeight=130;//单个图片的行的高度 aTl.setSize(280,150); //整个TileList的宽度和高度; aTl.move(20, 20); aTl.setStyle("contentPadding", 5); addChild(aTl); //---------------------------------------------------------------------------------------- function drawBox(box:MovieClip,color:uint):void { box.graphics.beginFill(color, 1.0); box.graphics.drawRect(0, 0, 100, 100); box.graphics.endFill(); }
相关文章推荐
- 系统滚动条类TileList举例说明
- Python中list的详细操作描述(举例说明)
- 系统自带滚动条类 UIScrollBar 使用举例
- Python中list的详细操作描述(举例说明)
- 举例说明用LinkedList实现栈的方法
- Python中list的详细操作描述(举例说明)
- .NET经常调用的外部系统函数举例说明
- gdb 中的list及右左法则举例说明
- ArrrayList 和 LinkedList 查询效率区别举例说明
- Python中list的详细操作描述(举例说明)
- ArrayList和LinkedList的区别是什么?举例说明LinkedList可实现的功能。
- Python中list的详细操作描述(举例说明)
- Python中list的详细操作描述(举例说明)
- ArrayList和LinkedList的区别是什么?举例说明LinkedList可实现的功能
- 举例说明如何用java中的LinkedList实现队列
- MM--移动类型的配置相关的系统表,举例说明SAP是如何根据配置抛帐的
- Python中list的详细操作描述(举例说明)
- 系统自带滚动条类 UIScrollBar 使用举例
- ArrayList和LinkedList的区别是什么?举例说明LinkedList可实现的功能
- ArrayList和LinkedList的区别是什么?举例说明LinkedList可实现的功能