Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Combo box populated by ASP, how?

Posted on 2000-03-20
13
Medium Priority
?
180 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 600 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
Suggested Courses

972 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