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

  • 相关阅读:
    .net core 操作域控 活动目录 ladp -- Support for System.DirectoryServices for Windows
    运行在 Android 系统上的完整 Linux -- Termux
    Windows Python 版本切换工具 --- Switch Python Version Tool For Windows
    简单的NLog配置文件
    python之set基本使用
    复习PHP的数组
    php动态修改配置文件
    制作一个php万年历
    一个简单的选项卡
    python操作文件的笔记
  • 原文地址:https://www.cnblogs.com/leon3286/p/1783775.html
Copyright © 2011-2022 走看看