Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-14-2002, 02:46 AM   #1
sum
Registered User
 
Join Date: Nov 2001
Location: Florida, USA
Posts: 22
Send a message via AIM to sum
Default List box component... How to use?

Hey peeps,

I know I should know how to use this thing but I have yet to figure it out. Cna someone point me in the dir of a tut I can use or just put it in simple english for me.

Thanks all!
SuM
sum is offline   Reply With Quote
Old 11-14-2002, 02:49 PM   #2
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
Default

works alot like the combo box... if you know one, you pretty much know them both... here is an example...
on your fla, put on a listbox with an instance name 'myList' (use the suffix '_lb' if you want the little dropdown list help thingie) -hope thats not too technical - hah.
also, for grins stick on a dynamic text box with name 'posts'.
then heres the code to test:
ActionScript Code:
arLabel=new Array("tg","sum","billyt","red penguin","pinkaboo","jesse","pixelwit"); arData=new Array(2477,10,3057,1608,1325,6679,975); //load the box with data/labels for(var i=0;i<arLabel.length;i++){     myList.addItem(arLabel[i],arData[i]); } //tell the list box to hide the scroll bar when the list is shorter than the box. myList.setAutoHideScrollBar(true); //set the change handler for the list box //this tells the list box what function to run //when an item is selected. //if you use the suffix '_lb' in your instance name, you will get the dropdown //box of all available methods for the listbox when writing your code. myList.setChangeHandler("itemPicked"); itemPicked=function(){     //an item has been selected:     //insert the data value in the box into the text box     var myVal=myList.getSelectedItem().data;     posts.text=myVal;     //just to display the scrollbar stuff, lets remove anyone who has less than     //1000 posts     if(myVal<1000){         myList.removeItemAt(myList.getSelectedIndex());     } };

hope this helps a bit.
also, don't forget to check the reference panel... lots of good explanations there.
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 01-26-2003, 09:04 AM   #3
dr.swank
abstraction=_root.truth;
 
dr.swank's Avatar
 
Join Date: Jun 2002
Location: Bonn, Germany
Posts: 779
Default

ahhhhh.. thanx for this tg.
dr.swank is offline   Reply With Quote
Reply


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 12:46 PM.

///
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.