would be good to get rid of yellow rectangles (with "Tab" navigation)...
FlepStudio has created a new free utility for Flash CS3/CS4 and Actionscript 3.0.
This is a ComboBox style web 2.0.
Graphically it is more beautiful of the ComboBox default Flash CS3 and CS4.
To use it is very simple, just a few lines of code, keep the MovieClip mc_blackcombobox in the library and the class BlackComboBx.as in the same folder of FLA file.
Included files
- main.fla
- BlackComboBox.as
Actionscript variables
- label: gets or sets the main label of the ComboBox
- list: gets or sets the Array of the drop down list menu
- rowCount: gets or sets the maximum number of rows that can appear in a drop-down list that does not have a scroll bar
- color: gets or sets the highlighted colors of the ComboBox
- text_color: gets or sets the text color of the ComboBox
Events
- OnSelection:String
Using BlackComboBox
Keep the MovieClip mc_blackcombobox in the library of FLA file.
Keep the file BlackComboBox.as in the same directory of FLA file.
Example of code:
Code:var black_combo_box:BlackComboBox=new BlackComboBox(); black_combo_box.label="my cars list"; black_combo_box.list=["Ferrari","BMW","Audi","Mercedes","Maserati","Alfa Romeo","FIAT","Wolkswagen"]; black_combo_box.rowCount=4; black_combo_box.color=0xBA0000; black_combo_box.text_color=0xFFFFFF; black_combo_box.x=stage.stageWidth/2-black_combo_box.width/2; black_combo_box.y=100; addChild(black_combo_box); black_combo_box.addEventListener("OnSelection",go); function go(evt:Event):void { trace("selected id= "+evt.target.id+"\n"+"selected label= "+evt.target.data); }Other customizations
You can manage all the rest by working at MovieClip mc_blackcombobox in library.
Source files:
would be good to get rid of yellow rectangles (with "Tab" navigation)...
Thanks. Very useful.
Nice. Thank you.
Excellent look and feel. 10/10
How would I add some external links to the drop down list rather than just have a trace event?
change function go() in main.fla like this:
Code:function go(evt:Event):void { //trace("selected id= "+evt.target.id+"\n"+"selected label= "+evt.target.data); switch(evt.target.data) { case "Ferrari": navigateToURL(new URLRequest("http://Ferrari.com"), "_blank"); break; case "BMW": navigateToURL(new URLRequest("http://BMW.com"), "_blank"); break; case "Audi": navigateToURL(new URLRequest("http://Audi.com"), "_blank"); break; case "Mercedes": navigateToURL(new URLRequest("http://Mercedes.com"), "_blank"); break; // all vendors case "Wolkswagen": navigateToURL(new URLRequest("http://Wolkswagen.com"), "_blank"); break; } }
Thank you uacomp, that looks good and I don't know why I didn't think of it before! Thanks again... Have a nice day.
![]()
Bookmarks