zoukankan      html  css  js  c++  java
  • 系统滚动条类TileList举例说明

    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();
    }
    

  • 相关阅读:
    EF框架开发后台错误问题集合
    如何实践MVP+RxJava+Retrofit(1)
    Android的FixScrollView自定义控件
    那些React-Native踩过的的坑
    P3105 [USACO14OPEN]公平的摄影Fair Photography
    模板合集
    关于最近情况的说明
    落谷P3941 入阵曲
    51nod 1952 栈
    BZOJ 2298: [HAOI2011]problem a
  • 原文地址:https://www.cnblogs.com/leon3286/p/1783775.html
Copyright © 2011-2022 走看看