Note that there are some explanatory texts on larger screens.

plurals
  1. POAS3 - Hiding TileList's background
    text
    copied!<p><img src="https://i.stack.imgur.com/VgLWu.jpg" alt="This Picture Shows The Issue"></p> <p>I'm using a tileList with a custom ImageCell Class and I would like to hide the grey background behind my M15 &amp; M19 buttons. I've tried setting the background.alpha &amp; opaqueBackground on the ImageCell Class &amp; TileList with no luck...</p> <p>Any help would be appreciated.</p> <p>edit2: Add the tilelist setup and the entire custom cell renderer for clarity...</p> <pre><code>//TileList Settings in main class tilelist.width = 235.53; tilelist.height = 592; tilelist.move(14, 118); tilelist.columnWidth = 220.53; tilelist.rowHeight = 53; tilelist.visible = true; tilelist.direction = ScrollBarDirection.VERTICAL; tilelist.setStyle("cellRenderer", UserListRenderer); tilelist.setStyle("contentBackgroundAlpha", 0); //Custom CellRenderer package { import fl.controls.listClasses.ICellRenderer; import fl.controls.listClasses.ImageCell; import fl.controls.TileList; import flash.text.*; public class UserListRenderer extends ImageCell implements ICellRenderer { public function UserListRenderer() { //inherit the variables from the parent super(); //we don't want to stretch our images to fit the size of the box loader.scaleContent = true; //change the cursor as if this was a button useHandCursor = true; } override public function set data(data:Object):void { super.data = data; // Set the default skin to be invisible. This is a bit // easier than creating a new skin, if your goal is // to hide the white background. this.setStyle("contentBackgroundAlpha", 0); } /** * Now we override the function that draws the layout * so we can move the image beside the text **/ override protected function drawLayout():void { //adjust the icon for any existing padding var imagePadding:Number = getStyleValue("imagePadding") as Number; //offset the image in the box so it's not touching the top of it loader.move(1, 0); var h:Number = height-(imagePadding*2);*/ var w:Number = width + (imagePadding*2); var h:Number = height + (imagePadding*2); if (loader.width != w &amp;&amp; loader.height != h) { loader.setSize(w,h); } //re-draw the image loader.drawNow(); //hide the original cellImage textField so we can display our new one later textField.visible = false; //adjust the background background.width = width; background.height = height; } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload