Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Combo Box Actionscript Help?



Hi Everyone,

I am a total newbie when it comes to the Components. I am trying to do three things with the combobox.

1. I need to select several items from several comboboxes and have there cost added up and displayed.

2.I also want to have the combox selections load external swf's into the current movie. (You can see the image to the right. It will change as you make your related selctions.)

3.I then will want to send all of these selections to a database.

Any suggestions? I have gone throught the Ultrashock Component Tutorials and they have been a big help.

Attached is a link to my mock up page. I can send the fla.
Design Center

Thanks,

THS2000



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 09-08-2005, 02:22 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Actionscript For Combo Box
I am looking for actionscript for a combo box that is similar to that of the component combo box in mx. Thanks

Combo Box Actionscript Help
I'm using a combo box with 8 items in it in Flash MX. What I want to happen is when the user selects one I would like it load a new movie. I thought I could do it by using this actionscript:

function onSelect(Finding the needle) {
loadMovie(findingNeedleMovie.swf, 1)
}

Unfortunately, it's not as simple as I thought. I am not very good with actionscript. Could someone please tell me how I can achieve this?

Actionscript Help Combo Box
How can the script below be recoded to work with a flash MX 2004 combo box?

// Main Functions.. This controls your Drop Down / Combo Box.

// The AddItems function assigns values to the drop down box from the external source
function AddItems() {
for (i=0; i<NumItems; i++) {
var Name = eval("Name"+i);
var DataRow = eval("DataRow"+i);
dropDown.addItem(Name, DataRow);
}
//Set ChangeHandler (this is the most important line).
dropDown.setChangeHandler("SelectItem");
}

// The SelectItem function tells the movie what to do when a user
// Clicks on a certain Item in the drop down movie - this is your OnChange Handler.

// In this example we use it to open up a new URL.
function SelectItem(){
URLName= dropDown.getSelectedItem().label;
URL= dropDown.getSelectedItem().data;

getURL(URL, "_blank");
}

Combo Box And Actionscript
Hi Everyone,

I am a total newbie when it comes to the Components. I am trying to do three things with the combobox.

1. I need to select several items from several comboboxes and have there cost added up and displayed.

2.I also want to have the combox selections load external swf's into the current movie. (You can see the image to the right. It will change as you make your related selctions.)

3.I then will want to send all of these selections to a database.

Any suggestions? I have gone throught the Ultrashock Component Tutorials and they have been a big help.

Attached is a link to my mock up page. I can send the fla.
Design Center

Thanks,

THS2000

ActionScript And Combo Box
I have a movie clip with a slide show. I've built a combo box with an
eventlistener to navigate between galleries.

Is there a way to build a button on another movie clip that will load
the slideshow WITH a specific gallery? As it is now, it defaults to
the first gallery and listens for a combo box change. I'd like to
build into an onRelease command a specific item from the combo box.


Thanks,
David

Actionscript Help Combo Box
How can the script below be recoded to work with a flash MX 2004 combo box?

// Main Functions.. This controls your Drop Down / Combo Box.

// The AddItems function assigns values to the drop down box from the external source
function AddItems() {
for (i=0; i<NumItems; i++) {
var Name = eval("Name"+i);
var DataRow = eval("DataRow"+i);
dropDown.addItem(Name, DataRow);
}
//Set ChangeHandler (this is the most important line).
dropDown.setChangeHandler("SelectItem");
}

// The SelectItem function tells the movie what to do when a user
// Clicks on a certain Item in the drop down movie - this is your OnChange Handler.

// In this example we use it to open up a new URL.
function SelectItem(){
URLName = dropDown.getSelectedItem().label;
URL = dropDown.getSelectedItem().data;

getURL(URL, "_blank");
}

Actionscript Help Combo Box
How can the script below be recoded to work with a flash MX 2004 combo box?

// Main Functions.. This controls your Drop Down / Combo Box.

// The AddItems function assigns values to the drop down box from the external source
function AddItems() {
for (i=0; i<NumItems; i++) {
var Name = eval("Name"+i);
var DataRow = eval("DataRow"+i);
dropDown.addItem(Name, DataRow);
}
//Set ChangeHandler (this is the most important line).
dropDown.setChangeHandler("SelectItem");
}

// The SelectItem function tells the movie what to do when a user
// Clicks on a certain Item in the drop down movie - this is your OnChange Handler.

// In this example we use it to open up a new URL.
function SelectItem(){
URLName = dropDown.getSelectedItem().label;
URL = dropDown.getSelectedItem().data;

getURL(URL, "_blank");
}

Combo Box Simple ActionScript
Simple question. How do i change the selected value of a combo box, using actionscript.

Reason?
I am creating a kind of Slide Show. There is a combo box at the top, containing a list of slide numbers. Selecting one of these slide numbers jumps the slide show to that particular slide. However, ifthe slide show progresses naturally, without using the combo box, the combo box says the title of the first slide all the time.

I have tried all sorts of script, but am really making it up now. The best i came up with (albeit completely wrong) is

Code:
_root.slideBox.selectedItem = "Slide 2"

Combo Box Control With Actionscript
I have created a menu for an online café. The display area is limited, so the menu items need to scroll within a frame of some sort. The menu items come in various sizes for example “small”, “medium”, “large”.
Each size has a different cost. E.g. “Cappuccino” has “Cappuccino Small”, “Cappuccino Medium”, “Cappuccino Large” with prices say “3.00”, “6.00”, “9.00”.

I have set up a Combo box to display each menu item. Displayed is the minimum code that shows this.
var myCappuccinoBox:ComboBox = new ComboBox();
:
myCappuccinoBox.addItem({label:"Orange Small"});
:
myCappuccinoBox.move(30, 165);
addChild(myCappuccinoBox);

I have a separate Combo box for the number of items
var myCappuccinoNoBox:ComboBox = new ComboBox();
:
myCappuccinoNoBox.addItem({label:"2"});
:
myCappuccinoNoBox.move(130, 195);
addChild(myCappuccinoNoBox);

The total for all drink items has an instance name “tbDrinkTot”

To scroll the menu items in the small display area I have nested/embedded the movieclip into a scrolling movie. At the moment I have used button controls to move the menu up and down. Any better suggestions on how to scroll the menu gratefully received. Currently I’m using the clickHandler functions

function clickHandler1(event:MouseEvent):void {
this.mcDrinkMenu.play();
}
btPlay.addEventListener(MouseEvent.CLICK, clickHandler1);
Questions in next post

Combo Box To Create An AttachMovie Actionscript
Hiya. What I have here is a choice for a user. On top is the message to explain anything if necessary. In the middle is the drop down menu into which the options are available and the bottom is sort of like to 'ok' button.

When user presses the button, a message should show up in the dynamic text box on top saying he didnt make a choice. Otherwise, the choice of the user is stored as a variable and used in a frame further.

This doesn't work and it's my first problem...

Also, when the button brings the user to the desired frame, depending on what option he chose, a movie clip should be attached to the main timeline. I don't want to do different frames for different options because for what I need to apply this, I have too many choice... (Did that syntax make any sense!?!...)

I enclose the .fla file, so if anyone knows what I could do or what I shouldn't have done please lemme know!
Thanx!

Combo Boxes Reseting In Actionscript
I have created a menu for an online café. The display area is limited, so the menu items need to scroll within a frame of some sort.
The menu items come in various sizes for example “small”, “medium”, “large”.
Each size has a different cost.
For example “Cappuccino” has “Cappuccino Small”, “Cappuccino Medium”, “Cappuccino Large” with prices say “3.00”, “6.00”, “9.00”.

I have set up a Combo box to display each menu item.

This is all explained under the ActionScript 2.0 category, but I have been advised I have submitted it in the wrong place. So I’m now inserting it here. I have left out the Combo box code included in the other entry.

I have a number of problems (see other entry under ActionScript 2)
Here is problem one again, I’ve tried a number of solutions, this one looked more promising.

Problem1
How does one reset the ComboBox to the “Home” position using ActionScript (CS3)? I tried using “myCappuccinoBox.setSelectedIndex(0);” with button Click. Among a variety of other attempts this seemed the most likely solution, but still gave an error “call to undefined method through a reference with static type fl.controls.ComboBox”. Do I have to add some other access statement e.g. “fl.controls.?????”. Does someone know how to reset my menu items?

Urgent Help With Flash Actionscript Combo Box...
Hi I'm trying to insert some data into my DB from two Combo Boxes in Flash. I'm not quite sure how to go about it. I have no idea how to give the combo box a 'var' value like we do for a regular textfield. I have other pages where I have regular text fields that work fine as I can specify the 'var' value in the properties but not for combo boxes. I'm new to actionscript so please bear with me. Can anyone help me please....
Thank you all in advance.

Action Script for my button:

Code:
on (press) {
loadVariablesNum
("http://localhost/Test/acadForm.asp",0, "post");
nextframe();
}
ASP CODE:

Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
strMajor = Request.Form("major")
strCollege = Request.Form("college")
'Response.Write(strMajor) & "<br>"
'Response.Write(strCollege) & "<br>"
MyPath=Server.MapPath("uginfo.mdb")
Set Conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & MyPath
SQL = "INSERT INTO acad_choices (major, college) VALUES('"&strMajor&"', '"&strCollege&"')"
'Response.Write(SQL)
conn.Execute(SQL)
%>

Urgent Help With Flash Actionscript Combo Box...
Hi I'm trying to insert some data into my DB from two Combo Boxes in Flash. I'm not quite sure how to go about it. I have no idea how to give the combo box a 'var' value like we do for a regular textfield. I have other pages where I have regular text fields that work fine as I can specify the 'var' value in the properties but not for combo boxes. I'm new to actionscript so please bear with me. Can anyone help me please....
Thank you all in advance.

Action Script for my button:

Code:
on (press) {
loadVariablesNum
("http://localhost/Test/acadForm.asp",0, "post");
nextframe();
}
ASP CODE:

Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
strMajor = Request.Form("major")
strCollege = Request.Form("college")
'Response.Write(strMajor) & "<br>"
'Response.Write(strCollege) & "<br>"
MyPath=Server.MapPath("uginfo.mdb")
Set Conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & MyPath
SQL = "INSERT INTO acad_choices (major, college) VALUES('"&strMajor&"', '"&strCollege&"')"
'Response.Write(SQL)
conn.Execute(SQL)
%>

Combo Box Actionscript Problem Please Takealook Guys
hi this is my code for a combo box button.

as you can see when a n option is selected, text from an external txt. is made visable in a field.

However my problem is that when i make one option and press the button to which this code is attatched, the text appears as expected. But when i make another selecltion from the combo box the text from the previous selection sticks not allowing me to see my new text .

can someone point out what i should do with my code in order to ensure that the previous selection is cleared from my text field so that the new text can be displayed.

cheers

please help im really stuck here


my code:

on(release){
if(distances.getselectedindex()==0)
{

loadvariables("aucklandtowellington.txt",text)
}

}

on(release){
if(distances.getselectedindex()==1)
{

loadvariables("christchurchandauckland.txt",text)
}

}

on(release){
if(distances.getselectedindex()==2)
{

loadvariables("christchurchandwellington.txt",text )
}

}

cheers again sean

I Need Good Advice(combo Box,basic Actionscript) Please Help
Thank you for reading this, i need some help with the Combox in flash8.
I know this is relatively simple to do but i cant find any clear help on how to make three combo boxes each with its own info to relate to you last choice.
its for a site, i need 3 dependable combo boxes
the first box: media type,each selection has sizes in its data(canvas,digital print,hand print,ect..)
the second box: size, according to slection of box (30X40,30X20,24X19ect..)
the third box: price, acording to the size and media(20,$40ect...)
obviously i dont understand event listeners at all. please please someone help me understand how to make 3 boxes link with oneanother.
thank you
very much
Kc

Populate Combo Box Values Using Another Combo Box Instance
Hi,
I have two combo boxes. The first combo box's data is added through an XMLConnector object, the second combo box, I would like to populate through an on (change) event in the first combo box. The items in the second combo box would relate to the selection made in the first combo box.

I have attempted the following within the Actions for the first combo box:

on(change) {
switch(this.value) {
case "value1":
comboBox2.addItem({Label:"Label",Data:"Data"});
break;
} // end switch
} // end event

which is not working.

should an event be dispatched by comboBox1 and a listener be attached to comboBox2? I can't find any examples of this on the internet.. but i might be using the wrong search terms. any help with this would be greatly appreciated. Seriously, i'll buy beers.

-Thanks

Combo Box...Please Help
Hello...

I have a combo box(vtgCombo) with values that, when selected, should jump to a certain scene. I have the following code written on the first frame of the timeline which the component lies on:

indexData = new Array();
indexData[0] = {label:"Select...", data:""};
indexData[1] = {label:"The Resort", data:"Resort"};
indexData[2] = {label:"Guest Rooms", data:"Intro"};
indexData[3] = {label:"Leisure", data:"Leisure"};
indexData[4] = {label:"Restaurants", data:"Restaurants"};
indexData[5] = {label:"Meetings", data:"Meetings"};
indexData[6] = {label:"Gallery Index", data:"Index"};

// Combo box attributes
vtgCombo.setDataProvider(indexData);
vtgCombo.setChangeHandler("sceneSelector");

// Playing the scene selected
function sceneSelector(){
gotoAndPlay(vtgCombo.getSelectedItem().data);


Would this conflict in any way what parameters are set on the box? I just can't get this to work. Any help is much appreciated.

Thanks!

COMBO BOX
Can anyone point me in the right direction on how to use a combo box to load MC's or to "goto" a particualr scene within a swf? or even call an outside swf to load? I would like to have the combo box as a "quick link" feature, but keep getting stumped with the action scripting...

http://www.redjetdesign.com/highwoods/

that's where is file is that I am working on, nevermind the homepage (I only use it really to test files) I haven't even considered building my own, I work for a commerical real estate brokereage that bombards me with flash projects like this one at the URL above, 2 - 3x or more a week. Any input. Thanks!

Please Help With Combo Box
I am try to use a combo box for the first time and do not know what to do. Lets keep it simple I have a combo box with labels (1,2,3,4,5) I want when the number is selected to display that number in a text box with variable (number).
The combo box instance name is (combo1). Could someone show me what what the action script function would be also show me what to put in the change handler(I think it would just be the function call but I am unsure). Thanks in advance. This is crucial for what I want to do so I hope someone can help.

Combo Box
Hi all,

I want to use the combo box component, the thing is I want it to jump to a label withing the same timeline, is this possible or do I have to go to a http//:www..etc

Many Thanks!

XML Fed Combo Box
Just been running through the macromedia xml gallery tutorial, now want to have a combo box to select each gallery via xml. How do i set the combo box to retrieve and display xml values?

I'm new to xml in flash - go easy on me!

Thanks

Combo Box
Hey there all you flashmasters outthere,

I got a problem with a combo box. It's located in an external *.swf which is being loaded into a dynamically created holder MC [loader.loadMovie("MC_containing_Combo_box.swf")]

It's working pretty fine. There's a big problem though, since the combo box loses the labels. You can still click it (i.e. the entries) and it's still working but you cant read the labels anymore !?!?!

Has anybody had this problem too? Does anybody know how to "cure" this ?!!?

Any help will be appreciated

Natsurfer

Combo Box Help
Dear all,

Could someone please explain to me in simple terms what code i put in the main timeline to make the main movie jump to a different frame when someone selects a choice in the combo box components list.

I have set up the combo box with all the choices but i dont know how to set up the change handler.

I want it so that when someone clicks on the first choice, the movie jumps to frame 12. when they select the second choice it jumps to frame 20, and when they select the default choice nothing happens.

Thank you very much.

Combo Box Help
Can someone please help me with this pain in the arse mx component problem.

I have placed a combo box component on the stage and filled in the labels.

There are 3 labels, the first says please select a language, the second choice says german language, and the third choice says english language.

Everything is ok so far, but what i need is the actionscript that i put in the main timeline to - do nothing if the user clicks on SELECT A LANGUAGE, send the main timeline to frame 10 if the person clicks on GERMAN LANGUAGE, or sends them to frame 20 if they click on ENGLISH LANGUAGE.

I have looked everywhere for the bloody answer and all i keep finding is useless examples using the trace command.

PLEASE PLEASE try to help me.

Thank you very much.

Combo Box
hi all

ive got a bit of a problem i'm trying to imbed the font for a flash mx combo box dose anyone know how to do it??

More Combo Box ?'s
I have a combo box that is getting its information from an array, is what i need to do is have combo box 1 populate another combo box with an array based on what was clicked on.

Hopefully this makes sense.

Thanks in advance for the help

MX Combo Box
How to create combo box like macromedia.com home page. Example: go to macromedia.com, please click any one of the shortcuts in the top flash part. there u can see the combo box...Can anyone help me?

Combo Box
I want to create a combo box with a list of approx. 10 labels. I want to be able to select a label from the combo box which opens up the relevant url for my label.
e.g. - I choose "dogs" from the combo box
- "dogs.html" opens.

I can't work out how to add the url elements, hopefully someone out there can help.


Thanks,
Darren

Combo Box
Hi all,

Is there any chance to select an item from a combo box via a button?
Sounds odd I guess. What I have is some sort of a quiz where people have to chosse answers from combo boxes.
Now I want to include a hint button to reveal the answer. That's why I need to kinda select the combo box item with a button.

Any ideas?
Natsurfer

Combo Box's
How do I assign a variable to a combo box so that when the user selects and option from the combo box, it can be sent to a cgi script.

I can set a input box with a variable, but how do i do the same thing for a combo box?

Combo Box
I am using the combo box component. When a user clicks on one of the drop down buttons I want that choice to come up later in a dynamic text box. This seems like it would be easy, but I can't find an example of it. Any ideas?

gamist

Combo Box
I am trying to use a combobox as a drop-down menu I have 5 basic subjects. What I am trying to do is simply advance t a frame in the movie related to the choice made in the box....Not only can I not get this to work, when I go to test the movie no words apear in the box until I click the drop-down arrow....... Please help....

Thank you
Anthony

XML Combo Box
I'm trying to build a dropdown menu which pulls the information from an XML Document.

What I need is for the Drop Down Menus to say it's "name", but display it's "value" as a variable on another frame.

ie: dropdown consists of 3 choices:

Name: Value:
Red red.com
Blue blue.com
Green green.com

If choice Blue is chosen, on the next frame, I would need it say blue.com


Any ideas or suggestions on how to write up the xml and fla code would be very helpful.

Thanks

Combo Box/asp
I have form that uses a combobox/dropdown and i am trying to submit the value of the combobox to and asp page ; but low and behold it is not working.

code on button..

on (release) {
models.getValue();
getURL("form_test.asp", "_blank", "POST");
}

code for ASP Page

myBody = myBody & "Info Requested: "& request.form("models") & vbcrlf

any thoughts as to what i am doing wrong??

much appreciated

Best Way To Use Combo Box
Hello,

NEVER used a Combo Box before but considering using one for choosing to display one member out of a list of members as part of a truck owners site.

I have not formatted the individual member sections because what I can or cannot do with the combo box will determine how I design the sections.

My question is can you use a Combo Box to go to specific frames in the timeline, and or load movie clips and swf files.

Depending on what the responses are, I may have some more questions but this is a good place to start.

Thanks!

Help I Almost Got It (combo Box)
I am new at flash but have been a developer for about 10 years now. I have went through all of the tutorials and everything else. I have been working on getting information from an external file into a flash movie that will update a dynamic drop down box. I will try my best to explain what I have going on below.

test.txt file
contents: intCount=8&txtVar1=10&txtVar2=20&txtVar3=30&txtVar 4=40&txtVar5=50&txtVar6=60&txtVar7=70&txtVar8=80&d one=okay&

If flash I have LoadVariables layer which has a movie clip on it.
The movie clip is setup like this:
frame 1:
_parent.stop();
done = "";
loadVariables("test.txt", this, "POST");

frame 2:
if (done == "okay") {
// all variables are loaded
gotoAndStop(4);
}

frame 3:
// loop back to text if all variables are loaded yet
gotoAndPlay(2);

frame 4:
trace("==================================");
_root.section = section;
intCounter = Number(intCount);
intCounter = intCounter+1;
trace(intCounter);
for (i=1; i<intCounter; i++) {
array[i] = this["txtVar"+i];
trace(array[i]);
}
_root.Combo1Array = array;
trace("==================================");

Now on the main movie I have another layer called LoadCombo and my script here is:
trace(_root.Combo1Array[1]);

and that is it.

When I test the movie the tracing on the movie clip shows my data from the external file and I can access it in the move clip. What i read was that "_root" would put it into the main movie that is the reason why I am saying in the last frame "_root.Combo1Array = array". However the "trace(_root.Combo1Array[1])" return undefined and I am at a lot at what to do now.

I was thinking I would be able to just do a databind on Combo1 and add the Combo1Array and the drop down would be filled in.

I forgot to mention that on the layer Load Combo I have a drop down box called Combo1.

Please help!!!!!!

thanks

Combo Box & PHP
I need help with a combo box...not sure how to actually get varibles from it. I want to do a simple mail form, using PHP and Flash, however, instead of the recipient being hardcoded....I would like the end user to select a recipient from a drop down list in a combo box
I'm doing this for a company, they want end users to be able to email different departments.

How do I pass variables from a drop down box in Flash to PHP? for a typical Mail Form?

Any help is greatly appreciated!

Thanks!

How To Add A Url To Combo Box
How do you add a url to a combo box is it

on [release]
geturl...........................?

How Do I Do This Combo?
I would like to show a series of names of people, and when a user moves their mouse over a person, I would like more information about that person to appear to the right or somewhere beside the name.

I will be updating this flash movie constantly, so I would think it would be easier to load all the text data from an external .txt file. Please help me and/or include a .fla file for reference. Thanks.

Combo Box
I'm having trouble figuring out how to put script in an combo box. What I want to do is have the user be able to select what song they want playing in the background. I know how to make the labels but is there a way to write code for each label individualy so that I can for say have them select on mozart and it will play mozart.

Combo Box
hello,
i have a small question regarding combo box! By default, a combo box's selected element in the unfolding list is highlighted by a deep grey. i've just modified the attributs of a combo box so that the default grey is lighter and more related to the colors of my site. The problem is that not only does the default settings highlight the selected choice in a deep grey, it also puts the text in white ( thus making it unreadable on a lighter grey as i've selected.

Where can i tell the combo box to not put the text in white when "over" element. I've tried editing the combo but the text inside the combo is a dynamic text set to black which exposes the variable in black. but probably theirs a script somewhere telling "on over choice highlight in grey and change text color to white"

thanks in advance
priff

Combo Box
Please tell me is there a way to force Combo Box to display list of options above it, instead of below it how its usually shown.

Thanks.

Combo Box
I have a form that my customers can edit and update. The form contains a combo box with about 5 options. The form posts to an asp.net page. I have everything working as far as updating the database from the form and repopulating the input boxes with their previous settings. The problem is how to repopulate the combo box with the choice they had previously made. Getting the variable value into the form is no problem I just need a small sample of code that tells the combo box to show their previous value not the default value. Thanks in advance.

Combo Box, And URL
Funny enough I never used the combo box.
Well, today I have to
When I click the drop down box and click a selection I want it to goto a web site. How can I accomplish this with the combo box?

I put info in the data field but it didnt work. How am I missing this? Makes me feel like a NEWB again.

Combo Box
Hi

How do you make the Flash ComboBox jump to HTML pages, Ive added in the options, but i need them to jump to the relevant pages when selected, also can you target a frame with them.

Cheers

Lee

Combo Box
I am using the following code to try to trace the selection by the user in a combo box named "myCombo". It's not working. Seems like this would be simple.

Any help would be appreciated. I am using Flash MX 2004 Professional.

Thanks!
Alysen

_root.myCombo.addItem("label", "data");
_root.myCombo.addItem("label2", "data2");
_root.myCombo.sortItemsBy("label", "ASC");

_root.myCombo.setChangeHandler("myValue");

function myValue() {
trace(_root.myCombo.getSelectedItem().label);
}

stop();

XML In Combo Box.....
Using this XML

[QUOTE<?xml version="1.0"?>
<creature>
<category id="mammal" has="hairy_skin,mouth,warm_blood">
<species id="cat" has="fur,tail,whiskers">
<breed id="tiger" has="stripey_fur"/>
<breed id="lion" has="brown_fur,mane"/>
<breed id="panther" has="black_fur"/>
</species>
<species id="dog" has="hair,tail,wet_nose">
<breed id="labrador" has="soft_hair"/>
</species>
<species id="pig" has="snout,trotters"/>
<species id="cow" has="nose,hooves"/>
</category>
<category id="reptile" has="scaly_skin,mouth,cold_blood">
<species id="lizard" has="tail,legs">
<breed id="iguana" has=""/>
</species>
<species id="snake" has="tail,no_legs,forked_tongue">
<breed id="cobra" has="hooded_head">
<subbreed id="greatcobra" has="big_hood"/>
</breed>
</species>
</category>
<category id="bird" has="feathers,beak,wings,warm_blood" />
<category id="fish" has="scales,mouth,cold_blood">
<species id="mullet" has="thick_lips"/>
<species id="pike" has="sharp_teeth"/>
</category>
</creature>[/quote]

can i adapt this AS to fill a combo box named "dropDown" with "species, breed and sub breed"

code:
dataXML = new XML();
dataXML.onLoad = convertXML;
dataXML.load("creatures.xml");
function convertXML () {
mainTag = new XML();
elementTag = new XML();
dataList = new Array();
elementList = new Array();
mainTag = this.firstChild;
if (dataXML.loaded) {
if (mainTag.nodeName == "category") {
dataList = mainTag.childNodes;
for (i=0; i<=dataList.length; i++) {
if (dataList[i].nodeName == "species") {
elementList = dataList[i].childNodes;
for (j=0; j<=elementList.length; j++) {
elementTag = elementList[j];
elementType = elementTag.nodeName;
if (elementType == "breed") {
breed = elementTag.firstChild.nodeValue;
}
if (elementType == "subbreed") {
subbreed = elementTag.firstChild.nodeValue;
}
}
// Adds the label and data to the URL.
dropDown.addItem(breed, subbreed);
}
}
}
}
}



many thanks

Combo Box
Anyone who can help, I am using a combo box component as a drop down list for an mp3 player and when testing in flash it works ok. However, when I export it to dreamweaver the drop down list doesn't operate as it does in flash. Am I missing something basic here or what?





when you're smiling, whe whole world smiles with you

Combo Box
How do i make a value apear in the editable are of the combo box based on an external value

Copyright 2005-08 www.BigResource.com, All rights reserved