Displaying Multiple Access Records with Flash and ASP
I wrestled for
quite sometime on how to integrate Flash with Active Server Pages and owe a
lot to some excellent tutorials available on the web :
www.15seconds.com/issue/010605.htm
and
www.asp101.com/articles/flash/
However, most of these tutorials only dealt with returning one row of information at a time. I was interested in displaying multiple records and fields simultaneously. One resource pointed the way and I used this start to arrive at the following solution.
Database
Download Access table here
ASP
Page
To get this to work,
you must format your ASP to output results in a way Flash can interpret them.
Flash reads variables in URL encoded format - i.e.:
&name = Bob
Flash sees this as the variable "name" having the value of "Bob". Sounds great, but how do I do that? Here is the code:
ASP explained
The code is fairly straightforward :
- Connect to your Access table and loop through each record
- As you loop set up a variable - here I use " collect " - and concatenate each new value to this variable as you loop through the data table. Also, after you add each new value to the value of "collect " add the "&," character. This will tell flash that a new value pair is coming as well as format the results so that Flash can handle them as an array.
- Response.write out the contents of the collect variable assigning these values to the variable "output"
- The process is the same for each table field you wish to return to Flash as you can see from my example with the variable "eoutput"
- Set up a variable named Counter and give it the value of 1. We will use this later to signal Flash that our results are ready to be displayed.
The output from this ASP page looks like this :
&output=Bill
Sanders,Mark Winstanley,Betty Boop,Chief Crazy Horse,JoJo Yes,Junior Whiz,Wild Bill,Calamity Jones,Louie Louie,New Kid,Delia Q. Sanders,Charley Clapp, George Galore,Harry Potts,Vern Lawrence,Holy Cow,end &eoutput=bill@sandlight.com,mark@smoggywood.com,poopoopeedo@easy.net, drums@feather.com,jeepers@castle.gov,buzz@wordnow.org |
Now - we are ready
to put these variables into Flash!
Next: The Flash side of things
Comments
Appreciatable effort !!!
I just wanted to thank you so much, as I've been through so much to find out the way in which I can do such things...as I'm kinda fluent in Flash 5 and ASP.NET, and wanted to get a way between them to get working together..especially with databases...
Thank you very much once again...
P.S. I know that you were talking about ASP, but ASP.NET won't differ a lot, it's all the same concept...
ASaP
Along these same lines, if anyone is interested, there's an excellent ASP generating wizard (shareware app) at:
www.data-asap.com
Free if you just need to display data and only $29 if you need your visitors to be able to add/remove/modify records!!
Tutorial Update
Display Images too ?
That's great and seems easy, but what about displaying images?
Or even, how can I do a 'mailto' for each name.
Thanks
You must me logged in to write a comment.