# MX ListBox Dynamic Height Problem

**URL:** https://forum.kirupa.com/t/mx-listbox-dynamic-height-problem/6756
**Category:** flash
**Created:** [October 15, 2002, 9:32pm UTC](https://forum.kirupa.com/t/mx-listbox-dynamic-height-problem/6756 "2002-10-15T21:32:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![LeonTrotsky](https://avatars.discourse-cdn.com/v4/letter/l/ed655f/32.png) [@LeonTrotsky](https://forum.kirupa.com/u/LeonTrotsky)
#### Post date: [October 15, 2002, 9:32pm UTC](https://forum.kirupa.com/t/mx-listbox-dynamic-height-problem/6756/1 "2002-10-15T21:32:12Z")

</div>

Why? Why? Why?

I’m using the Flash MX ListBox UI Component, attempting to set the label height dynamically (to account for wraping text).

Please note the following (simplified) code in FLabel:

This does NOT work:

//::: PUBLIC METHODS  
FLabelClass.prototype.setLabel = function(label)  
{  
// set height  
this.labelField.\_height = 15;  
}

But this does:

//::: PUBLIC METHODS  
FLabelClass.prototype.setLabel = function(label)  
{  
// set textColor  
this.labelField.textColor = 0xffffff;  
}

Thoughts? Suggestions on another direction? Sympathy?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 15, 2002, 9:49pm UTC](https://forum.kirupa.com/t/mx-listbox-dynamic-height-problem/6756/2 "2002-10-15T21:49:53Z")

</div>

I was under the understanding that labels would not wrap under the component. You can change width and size of the component, but I dont know of a way to make the label wrap. Perhaps someone will educate us.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 16, 2002, 5:54pm UTC](https://forum.kirupa.com/t/mx-listbox-dynamic-height-problem/6756/3 "2002-10-16T17:54:27Z")

</div>

You can force a label to wrap thusly:

this.labelField.autosize = “left”;
