PDA

View Full Version : HTML Form Select To Flash


brendanww
03-13-2005, 11:40 PM
Hi, I was wondering if there was a way to create a select form in flash with actionscript? If not, what would be the easiest way to create a dynamic dropdown/select menu?

CyanBlue
03-13-2005, 11:43 PM
Howdy and Welcome... :)

Flash has a component called ComboBox and I think that's what you are looking for... Go check it out... ;)

brendanww
03-15-2005, 01:09 AM
Thanks for the welcoming and for the step in the right direction. I went through the flash documentation and got my comboBox working alright. I just have a few questions I haven't found awnsers to on the net (sorry in advance if there was already a forum topic or tutorial that I didn't find here pertinent to my questions). When adding new items dynamically with addItem, the first value of the function is what will appear in the dropdown menu and the second value is the actual value (sort of like in html: <option value="actualvalue">appearance</option> | flash parallel would then be: addItem("appearance", "actualvalue")?
How do I change the appearance of the arrow and the arrowbox (note: ive had problems getting the border to fully look the way I want it to too. flash documentation seems not to be that great based on the comments)?

For other people trying to design comboBoxes, this is my source and I've been able to skin everything except the arrowbox and arrow:

onClipEvent(load)
{
this.setStyle("buttonColor", "0x67652E");
this.setStyle("borderCapColor", "0x67652E");
this.setStyle("shadowCapColor", "0x67652E");
this.setStyle("highlightColor", "0x67652E");
this.setStyle("shadowColor", "0x67652E");
this.setStyle("dropDown", "0x67652E");
this.setStyle("borderColor", "0x67652E");
this.setStyle("backgroundColor", "0xD0CA2D");
this.setStyle("fontSize", "9");
this.setStyle("fontFamily", "Arial");
this.setStyle("color", "0xA6A242");
this.setStyle("rollOverColor", "0xE5DF3F");
this.setStyle("selectionColor", "0xF7F03D");
this.setStyke("ComboDownArrowDownName", "0xFF0000");
cats = new Array("Soundtracks", "Rock", "Rap", "Hip-Hop", "Alternative Rock");
representatives = new Array("soundmusic", "rock", "rap", "hiphop", "altrock");
for(i=0; i<representatives.length; i++)
{
this.addItem(cats[i], representatives[i]);
}
}

CyanBlue
03-15-2005, 01:30 AM
Uh... I feel really dumb... I don't understand the question... :(

BTW, you have a typo in your code... 'setStyke' should be 'setStyle'...

brendanww
03-15-2005, 03:18 AM
Uh... I feel really dumb... I don't understand the question... :(

BTW, you have a typo in your code... 'setStyke' should be 'setStyle'...
I phrased my questions incomprehensively, don't feel dumb. The first one I awnsered for myself.

For my second question, I've now made a screencap of the comboBox and have circled the area I haven't been able to style. It is in the attachment.

CyanBlue
03-15-2005, 04:41 AM
Uh... Did you try with 'face'???

brendanww
03-15-2005, 01:07 PM
by using face, do you mean like this?
this.setStyle("face", "0x67652E");

if so, yes :) If not, I'm not sure what you mean by that.

CyanBlue
03-15-2005, 04:52 PM
Yes, that's what I meant... I guess it did not do the job, right???

I am not really good at skinning component... But if you could create a simple sample movie with that code and the component on the stage, I'll take a look to see if I can help further... ;)

brendanww
03-15-2005, 10:34 PM
Yes, sorry, for not clarifying, using 'face' did not work. I'm not sure who the forum moderators or admins are (if anyone could give me a link to a list of them, that'd be great :) ), but I think I might get a few more responses for this problem in the flash mx 2004>components forum from people who've had a similar problem. Thanks for all the help you've given CyanBlue, I figure I can always create my own dropdown customly, but it's much more convenient to use a component in my opinion :D

edit: just viewed your sig CyanBlue, could you perhaps move this thread please?

CyanBlue
03-16-2005, 01:42 AM
I just moved the thread... and you might want to upload a simple sample so that people can actually see what's going on... I think that's the easiest way to solve the problem... ;)

brendanww
03-25-2005, 08:14 PM
ok, I have the swf and fla files uploaded.

>>SWF File (http://www.phpaib.com/flash/combobox.html)
>>FLA File (http://www.phpaib.com/flash/combobox.fla)

CyanBlue
03-25-2005, 08:41 PM
Did some searching and I don't see any name specified to that section... and all the examples online still have the gray area... Hm... :(

Good article here in case somebody need this info, it won't do anything good to you brandanww...
http://imm.sheridanc.on.ca/imm2004/bakerjam/tutorial/