Solved

Combo box populated by ASP, how?

Posted on 2000-03-20
13
174 Views
Last Modified: 2010-05-18
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!
0
Comment
Question by:gindala
  • 5
  • 4
  • 3
  • +1
13 Comments
 
LVL 2

Expert Comment

by:coopa
ID: 2640291
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
 

Author Comment

by:gindala
ID: 2640302
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
 
LVL 3

Expert Comment

by:SuperMario
ID: 2647853
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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:gindala
ID: 2647991
If you could give me a working example I would apprecaite it!
0
 
LVL 3

Expert Comment

by:SuperMario
ID: 2649544
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
 

Author Comment

by:gindala
ID: 2652385
thanks! I eagerly await your next mail!
0
 
LVL 7

Expert Comment

by:ssdesign
ID: 2771989
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
 
LVL 7

Expert Comment

by:ssdesign
ID: 2771991
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
 

Author Comment

by:gindala
ID: 2772167
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
 
LVL 7

Expert Comment

by:ssdesign
ID: 2785164
I'll post an .fla for you today later in the day. Hope it will help you understand what i ment.
0
 
LVL 3

Expert Comment

by:SuperMario
ID: 2848120
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
 
LVL 3

Accepted Solution

by:
SuperMario earned 200 total points
ID: 2848132
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
 

Author Comment

by:gindala
ID: 2858742
Comment accepted as answer
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to record live broadcast.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now