Solved

Combo box populated by ASP, how?

Posted on 2000-03-20
13
172 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

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

Expert Comment

by:SuperMario
Comment Utility
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
Comment Utility
thanks! I eagerly await your next mail!
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 7

Expert Comment

by:ssdesign
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Comment accepted as answer
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

771 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

7 Experts available now in Live!

Get 1:1 Help Now