Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-07-2003, 04:41 AM   #1
Registered User
Join Date: Jan 2003
Posts: 8
Default getting component.setWidth working?

Anyone tried playing around with the FListBox or FComboBox setWidth option? its got me stumped

Perhaps im missing something obvious....

i've got a load of dynamic content im loading into a FListBox from a PHP file (this works np), then checking the longest string (from the PHP file) with a view to using this amount as a guide to setting the width of my FListBox.

sounds simple enough but .setWidth or .setSize has no effect, including when i use it with .setRowCount

i've gone thru the MM site & most FlashMX forums and there's no additional info appart from the Manual:

Method; specifies the width of the list box, in pixels. This method is useful for setting the width of list box when FListBox.setRowCount is used to determine the height.

thanks in advance for your help
shaft7 is offline   Reply With Quote
Old 01-07-2003, 01:56 PM   #2
Registered User
Join Date: May 2002
Posts: 157

I don't know if this helps, but I got the following to work.

ActionScript Code:
function getWidth() {     var longest = 0;     var len = mylistbox.getLength();     for (i=0; i<len; i++) {         var count =  mylistbox.getItemAt(i).label;         if (count.length > longest) {             longest = count.length;             }     }     mylistbox.setWidth(7*longest);     } getWidth();
lbower is offline   Reply With Quote
Old 01-07-2003, 02:19 PM   #3
Join Date: Jun 2001
Location: portland, or
Posts: 8,106

i don't know what your doing, but this set the width of the list box fine for me.
ActionScript Code:
cb=this.attachMovie("FListBoxSymbol",cbox,1); //set width to 100 cb.setWidth(100); //set width to 250 //cb.setWidth(250);
what the hell was i thinking?

Last edited by tg; 01-07-2003 at 02:22 PM.
tg is offline   Reply With Quote
Old 01-07-2003, 03:01 PM   #4
Registered User
Join Date: Jan 2003
Posts: 8

Ah thats it, attach the FListBoxSymbol from the Library

lbower, nice function for checking the longest string!

thanks both of you!
shaft7 is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 01:57 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.