24 Oct
Posted by: admin in: Flash CS3, Solutions, actionscript 2
If you are a flash developer, you should have seen lots of comboBox designs and they're always different from each other. And the default comboBox component in flash? You know how it is, I realy don't need to say anything about it.
So, I needed a comboBox that is easily editable, easy to use and more developer friendly; and I decided to create one. So here it is:
And yeah, it's open source and licensed under creative commons noncommercial license.
You can edit the skin, just like editing a movieclip and use its methods as easy as standard combobox.
It has ability to arrange the position of the list automatically, according to the combobox' positon on stage, so the list will be opening on the above or below of the combobox.
comboBox.dataProvider("String","String","String","String");
comboBox.dataProvider({label:"String", data:2},{label:"String", data:3},{label:"String", data:4});
comboBox.addItem("String");
comboBox.addItem({label:"String", data:2});
comboBox.listItemsLeftMargin = 0;
comboBox.listItemsRightMargin = 0;
comboBox.listItemsTopMargin = 0;
comboBox.listItemsBottomMargin = 0;
comboBox.itemDefaultColor = 0x3CBDE3;
comboBox.itemOverColor = 0x3399CC;
comboBox.itemPressColor = 0xFFFFFF;
comboBox.itemSelectedColor = 0xA4E0F2;
comboBox.itemDefaultTextColor = 0x003366;
comboBox.itemOverTextColor = 0x000000;
comboBox.itemPressTextColor = 0x999999;
comboBox.itemSelectedTextColor = 0x3333;
comboBox.setSize(150);
comboBox.size = 150 ;
comboBox.value;
comboBox.getValue();
comboBox.getSelectedItem();
comboBox.getSelectedIndex();
comboBox.clear();
comboBox.length;
Click here to download the component.
(I appreciate your donations)
Please send your comments, suggestions and any enhancements you made on the comboBox, so we can build it together.
Tags: combobox, combo box, dropdown, selectbox, pulldown, component, free, open source, easy, editable, flash, as2
5 Responses
Alberto
07|Jun|2009 1ok
Rodrigo
02|Sep|2009 2Hi!
That’s a great idea. The default combobox is really hard to customize.
I just found a problem with this component: Accented labels are not correctly displayed. Eg., ‘Amapá’ shows ‘Amap’; ‘Rondônia’ shows ‘Rondnia’, and so on.
Hope it helps.
Thanks!
Kathleen
23|Oct|2009 3This is so helpful! Thank you. I have a coding question for you though. Can you help?
I used your combobox and changed the look of it. I then created three different instances of the combobox with their own arrays (so there are three dropdown boxes after publishing). After the selections have been made by the visitor I’m wanting these three selections to work together to create a result which will appear in a dynamic text box after a “calculate button” is pushed.
How do I define these components in my code that is placed on my calculate button. Basically what name am I looking for? I don’t know how the code will specifically look for each selected array.
I can send you an example of what I’m trying to do if that will help. I’d appreciate any assistance.
Thanks!
admin
24|Oct|2009 4can you use the “instance names” of the combobox movieclips?
Tiago
06|Jan|2010 5Rodrigo,
Just choose “Anti-alias for readability” in the Properties tab (“listItem” layer inside the “listItem” movieclip).
Leave a reply
Search
Categories
Recent Comments
Blogroll
A design creation of Design Disease
Copyright © 2008- flalog – Flash Actionscript Tutorial Solution Experience - is proudly powered by Mediatemple
Powered by