Modify the tileList style of the flash cs4 component

Source: Internet
Author: User

Previously, I used flex components for development. I used flash components today. The default style does not satisfy me.
Especially when the text in the text is smaller than 12px, It is very vague and unclear.
Therefore, you need to modify the style of the flash component.

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
. 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 );

}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.