# FINALLY: Transparent Tree or List - Solved!

**URL:** https://forum.kirupa.com/t/finally-transparent-tree-or-list-solved/185452
**Category:** flash
**Created:** [April 13, 2006, 2:07pm UTC](https://forum.kirupa.com/t/finally-transparent-tree-or-list-solved/185452 "2006-04-13T14:07:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mquinan](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@mquinan](https://forum.kirupa.com/u/mquinan)
#### Post date: [April 13, 2006, 2:07pm UTC](https://forum.kirupa.com/t/finally-transparent-tree-or-list-solved/185452/1 "2006-04-13T14:07:43Z")

</div>

Hi All  
I’m puzzling with this for a while and now I finally reached a solution!  
To make the Tree or List background transparent use the following code:

```
        mx.controls.treeclasses.TreeRow.[COLOR=#003399]prototype[/COLOR].drawRowFill = mx.controls.listclasses.SelectableRow.[COLOR=#003399]prototype[/COLOR].drawRowFill = [COLOR=#003399]function[/COLOR] (mc:[COLOR=#003399]MovieClip[/COLOR], newClr:[COLOR=#003399]Number[/COLOR]) { 
[COLOR=#ff9900]//Author: Marcelo Quinan &lt;marcelo@aretha.com.br&gt; - [http://www.aretha.com.br](http://www.aretha.com.br/) 

```

[/COLOR] [COLOR=#ff9900]//You can freely use this code, but please don’t remove the credits. Thanks!  
[/COLOR] [COLOR=#ff9900]//This code set the list and tree components bg’s to transparent. Put it before populating the components  
[/COLOR] switch (mc.[COLOR=#0000cc]\_name[/COLOR]) {  
case “bG\_mc” :  
[COLOR=#ff9900]//Alpha when the row is not selected  
[/COLOR] [COLOR=#003399]var[/COLOR] tempAlpha = 0;  
[COLOR=#003399]break[/COLOR];  
case “tran\_mc” :  
[COLOR=#ff9900]//Alpha when the row is selected  
[/COLOR] [COLOR=#003399]var[/COLOR] tempAlpha = 25;  
[COLOR=#003399]break[/COLOR];  
[COLOR=#003399]default[/COLOR] :  
[COLOR=#003399]var[/COLOR] tempAlpha = 100;  
}  
mc.[COLOR=#003399]clear/COLOR;  
[COLOR=#ff9900]//Here’s the trick:  
[/COLOR] mc.[COLOR=#003399]beginFill[/COLOR](newClr, tempAlpha);  
mc.drawRect(1, 0, [COLOR=#003399]this[/COLOR].\_\_width, [COLOR=#003399]this[/COLOR].\_\_height);  
mc.[COLOR=#003399]endFill/COLOR;  
mc.[COLOR=#0000cc]\_width[/COLOR] = [COLOR=#003399]this[/COLOR].\_\_width;  
mc.[COLOR=#0000cc]\_height[/COLOR] = [COLOR=#003399]this[/COLOR].\_\_height;  
[COLOR=#ff9900]//Hide the main bg of component  
[/COLOR] [COLOR=#003399]this[/COLOR].[COLOR=#0000cc]\_parent[/COLOR].[COLOR=#0000cc]\_parent[/COLOR].depthChild0.[COLOR=#003399]\_alpha[/COLOR] = 0;  
};

Hope this helps!  
Marcelo Quinan
