Combo box populated by ASP, how?

I need to display a list of countries generated by an ASP file in a flash combo box. First of all, I'm having a hard time finding any information on how to access the combo box properties. Does anyone have any idea I will do this? If the user clicks on the country then it should send through a variable back to the ASP file that will display that countries' information. My biggest problem is how I will get the combo box to list the countries generated by the ASP and how I will embed the variables into each combo entry that will call the ASP when it's clicked. Thanks a lot!
gindalaAsked:
Who is Participating?
 
SuperMarioConnect With a Mentor Commented:
Then to populate each variable, load the data into emulated arrays which are really sub movie clips of your combo movie clip.

So you have one movie clip that is called ComboBox made up of several smaller text fields which you can duplicate and assign an instance name to on the fly. You may have four fields named f_1 through f_4. Then assign your ASP data by looping through each index and switching until you hit the limit (which you should define in your ASP script too).

I know it's complicated but it's really helpful if you understand what I'm saying.
0
 
coopaCommented:
This is not a solution, but just may help.

As far as i know there is no method of getting information from an asp into flash... however it maybe possible by getting the asp to generate the <object> code and pass extra parameters into the movie.

I do know that the easiest way to get data into flash is via the load variables command.

Can you not get your asp to generate a text file with all of the options that will populate the combo box ?
obviously this will only work for single user systems, as the text file will be overwritten... okay bad idea...

0
 
gindalaAuthor Commented:
no i can pull that data from an ASP file into a Flash document, and into text fields, but not into the combo box.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
SuperMarioCommented:
All you need to be able to do is populate an "array" of variables with your ASP data (easily done with Load Variables) and then create as many combo box items as there are "elements" of your "array."

Note the quotations: Arrays in Flash are really not arrays at all, but rather a variable-naming trick similar to real arrays. Let me know if you need an example.

-Dan
0
 
gindalaAuthor Commented:
If you could give me a working example I would apprecaite it!
0
 
SuperMarioCommented:
I'll work on one for you this morning (using a text file, not ASP... but it will still illustrate dynamic filling).

Here's what you need to know in the meantime.

First off, hypothetically, ASP has generated a string similar to this:

c1=Albania&c2=Argentina&c3=Bolivia&elements=3

You're going to load that into your Flash movie, so now you have three variables named c1, c2, and c3, and one variable telling you how many elements you have.

Now when you refer, call, or change these variables in a loop process, you refer to them like this:

Set Variable: "c" & numCounter = newValue

See? The c and the current loop number are concatenated to actually form the variable name. So, if you wanted to nullify all fields in an array called a(n) with 12 elements (the 12 is held in a value called elements) you would use tthis code snippet in your Flash Actions:

Set Variable: "numCount" = "0"
Loop While (numCount < elements)
      Set Variable: "a" & numCount = ""
      Set Variable: "numCount" = numCount + 1
End Loop

^ Pasted directly from the Actions window.

There is some working code to get you started. Now, a hint on the combo box while I'm working:

Hold a text field in a movie clip and duplicate it as necessary in another loop.

I hope this helps you some more!

-Dan
0
 
gindalaAuthor Commented:
thanks! I eagerly await your next mail!
0
 
ssdesignCommented:
I think i have solved your prodlem.

To populate the combo box what you need to do is following.

Currently you must be having the text fields and the button that get the list in the same frame.

Now convert the text fields into a movie clip and give it an instance name of say text.

Then give ths action to the button that get the countries:

On (Release)
      Load Variables ("temp.txt", "text")
End On

Here you have targetted the movie clip text you just created and loaded a text file named temp.txt which presumably can be generated by an ASP script.

This way you can populate the combobox.
0
 
ssdesignCommented:
I think i have solved your prodlem.

To populate the combo box what you need to do is following.

Currently you must be having the text fields and the button that get the list in the same frame.

Now convert the text fields into a movie clip and give it an instance name of say text.

Then give ths action to the button that get the countries:

On (Release)
      Load Variables ("temp.txt", "text")
End On

Here you have targetted the movie clip text you just created and loaded a text file named temp.txt which presumably can be generated by an ASP script.

This way you can populate the combobox.
0
 
gindalaAuthor Commented:
um that's an awfully broad description, you'll have to give me working code, because the problem lies to take the text from the text field and then populate it into a combobox and add links to the items listed.
0
 
ssdesignCommented:
I'll post an .fla for you today later in the day. Hope it will help you understand what i ment.
0
 
SuperMarioCommented:
If you're wondering how to get ASP variables from the ASP script into Flash, write this in your ASP script:

<%@Language="VBScript"%>
<%
Dim var1
Dim var2

var1 = "Test variable 1"
var2 = "Ooga booga boogey"

response.write("var1=" & Server.URLEncode(var1) & "&var2=" & Server.URLEncode(var2))
%>

This returns a line like this to Flash:

var1=Test+variable+1&var2=Ooga+booga+boogey

After using the LoadVariables statement you will now have your Flash vars set to your ASP data.

-Dan
0
 
gindalaAuthor Commented:
Comment accepted as answer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.