Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-17-2002, 01:47 PM   #1
spiralelf
Registered User
 
Join Date: Aug 2002
Posts: 6
Default how to use the ComboBox component

Can someone please tell me how to use the ComboBox component in flash mx?

I have never used it before and would like to use it on my website - ambitious, I know. Even more ambitious is the fact that I'd like to link it to a database using either PHP or ASP (unfortunately I dont know any ColdFusion).

Can anyone please explain, or point me in the direction of a tutorial, that explains things to a beginner like me?


<thought>components in Flash mx are great, just with they came with instructions!</thought>
spiralelf is offline   Reply With Quote
Old 09-17-2002, 04:17 PM   #2
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default Re: how to use the ComboBox component

Quote:
Originally posted by spiralelf

<thought>components in Flash mx are great, just with they came with instructions!</thought>
they do, check your flash reference panel.

for your question, do a couple tests to get used to using the component.

ActionScript Code:
//create an array for labels var arLabels=new Array("One","Two","Three"); //create an array for data var arData=new Array(1,2,3); /* put your combo box on the stage and give it an instance name     use 'test_cb' ... adding the _cb will trigger the actionscript     editor to popup the methods of the object... this will help you     as you get started */ // load the data for(var i=0;i<arData.length;i++){   //actually load the label and data into the combo box   test_cb.addItem(arLabels[i],arData[i]); } /*you should now have a combobox filled with labels and data.    however you can't see the data, so lets do a test by clicking    an item in the combobox and doing a trace to see the data */ /*set your change handler for the combo box... this (the change    handler) tells the combo box what to do when the user clicks on    it. */ test_cb.setChangeHandler("onItemPicked"); //now write the function fired by the changehandler onItemPicked=function("test_cb"){   //trace the data that was picked   trace(test_cb.getSelectedItem().data); };

well... this kinda turned into a mini tutorial... sorry about that. this may or maynot work, as it was done on the fly.
however all the methods i used are in the documentation.
also, once you get this part working, and you understand whats going on, then run it all the same way, except instead of hadcoding your arrays for labels and data, look up the LoadVars() object, and read the values from a text file. once you got that down, then it will be time to learn some asp/php and how to use that technology to create the text file on the fly from a db.

good luck.


oh ya, there are lots of tuts out there on both php and asp for this kinda stuff, you just need to pick what you want to use and start searching.
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 09-19-2002, 10:05 AM   #3
spiralelf
Registered User
 
Join Date: Aug 2002
Posts: 6
Default

Hi tg

Thanks for telling me about the reference panel, I never knew that!

And thanks for your mini tutorial - I will be spending several hours working on your suggestions and trying to understand what is going on.

<quote>oh ya, there are lots of tuts out there on both php and asp for this kinda stuff, you just need to pick what you want to use and start searching.</quote>

Can you point me in the direction of a few good one? (preferably PHP)

Thanks, your help is greatly appreciated

-- spiralelf
spiralelf is offline   Reply With Quote
Old 04-11-2003, 07:47 PM   #4
Twister
Registered User
 
Join Date: Feb 2002
Location: Minneapolis
Posts: 77
Send a message via AIM to Twister Send a message via Yahoo to Twister
Default

Please Help me too.

I've read the instructions and there is one thing that is bugging the hell out of me. Where is the selected items' data stored?!!!

Ok here is what i did.

I put a component on the stage and called it dropDown. Then filled it with Labels and Data in the properties window. Then i have a function called changeContent that is referenced by the ComboBox. The only problem is I don't know how to get the data of the item i selected.

Lable1 : New and Events
Data1: 10

Now in the function i want to do this:

_root.content.gotoAndStop(Data1) but I can't get it to work for the life of me. Ahhh. I just want to know where the data of the item i selected is stored!!!!!
Twister is offline   Reply With Quote
Old 04-11-2003, 08:23 PM   #5
freddycodes
Master of Nothing
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468
Default

Quote:
Originally posted by Twister
Please Help me too.

I've read the instructions and there is one thing that is bugging the hell out of me. Where is the selected items' data stored?!!!

Ok here is what i did.

I put a component on the stage and called it dropDown. Then filled it with Labels and Data in the properties window. Then i have a function called changeContent that is referenced by the ComboBox. The only problem is I don't know how to get the data of the item i selected.

Lable1 : New and Events
Data1: 10

Now in the function i want to do this:

_root.content.gotoAndStop(Data1) but I can't get it to work for the life of me. Ahhh. I just want to know where the data of the item i selected is stored!!!!!

You need to use getValue() its listed in the reference panel.

ActionScript Code:
function changeContent(what) {      gotoAndStop(what.getValue())}
freddycodes is offline   Reply With Quote
Old 04-11-2003, 08:29 PM   #6
Twister
Registered User
 
Join Date: Feb 2002
Location: Minneapolis
Posts: 77
Send a message via AIM to Twister Send a message via Yahoo to Twister
Default

Thanks for the help. I started back at square one and everything worked for once, Then i went into my big flash file and found two conflicting scripts. Why flash didn't tell me there was an issue is beyond me. OH well.

Thanks!
Twister 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 05:19 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.