Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-08-2005, 11:26 PM   #1
Registered User
Join Date: Jul 2004
Posts: 36
Default displaying results from an Access DB in Flash


I wondered if someone here could help me with a problem that i'm having trouble with.

I have a access database, and an asp script that produces the results from a query as variables that I pass into Flash to display. It took some time to suss out and all appears to work fine.

One of the columns is a list of filenames, a thumbnail image. What I need is to display the image thumbnail as opposed to the filename.

below is the code.

the first is the list2.asp

IMSrc = "dib/gen_dib_data/images/"
THSrc = "dib/gen_dib_data/thumbs/"
IDI = "GE"
%> <%
Dim RecordView, Rst1, output1, collect1, SQL

Set RecordView = Server.CreateObject("ADODB.Recordset")

SQL="SELECT DISTINCT Photo.PDesc, Photographer.Fullname AS Expr1, Photo.PhotoID, Photo.[Date], Photo.[Size], Photo.Filename, Photographer.photogID, Photographer.GalleryLink FROM Photographer AS Photographer_1, (tCat INNER JOIN tSCat ON tCat.CatID = tSCat.CatID) INNER JOIN ((Photo INNER JOIN Photographer ON Photo.PhotogID = Photographer.photogID) INNER JOIN (tSSCat INNER JOIN SSC2Photo ON tSSCat.SSCatID = SSC2Photo.SSCatID) ON Photo.PhotoID = SSC2Photo.PhotoID) ON tSCat.SCatID = tSSCat.SCatID WHERE (((tCat.CatID)=37));"
   Recordview.open SQL, "DSN=gen_dib_data"

Do While Not RecordView.EOF

   collect1 =collect1 & IDI&"-" & Rst1&","
   collect2 =collect2 & Rst2&","
   collect3 =collect3 & Rst3&","
   collect4 =collect4 & THSrc & Rst4&","


   output1="&output1="& collect1 & "<br>"
   Response.Write output1
   Response.Write "&"
   output2="output2="& collect2 & "<br>"
   Response.Write output2
   Response.Write "&"
   output3="output3="& collect3 & "<br>"
   Response.Write output3
   Response.Write "&"
   output4="output4="& collect4 & "<br>"
   Response.Write output4
   Response.Write "&"

   Counter = 1
   Response.Write "Counter=" & Counter 
   Response.Write "&"

Set RecordView = Nothing

These are the results I get ready for flash to read in:

&output2=Castle,Hadrians Wall,Large House,
&output3=Stuart Thomas,Stuart Thomas,Stuart Thomas,
The following code is the actionscript that I use to display the results:

ActionScript Code:
// depth depth = -1; // hide the origional clips Rst1._visible = 0; Rst2._visible = 0; Rst3._visible = 0; Rst4._visible = 0; // split up the array by looking for the commas Rst1_array = output1.split(","); Rst2_array = output2.split(","); Rst3_array = output3.split(","); Rst4_array = output4.split(","); // get the length of the array Rst1_length = Rst1_array.length; Rst2_length = Rst2_array.length; Rst3_length = Rst3_array.length; Rst4_length = Rst4_array.length; // set the start y position (x position depends on where you put it on the screen) yposition = 38; // looping everything for (i=0; i<Rst1_length; i++) {     // Rst1     duplicateMovieClip(Rst1, "Rst1" add i, depth);     setProperty("Rst1" add i, _y, yposition);     Rst1.Rst1 = Rst1_array[1];     set("Rst1" add i add ".info", Rst1_array[i]);     depth--;         // Rst2     duplicateMovieClip(Rst2, "Rst2" add i, depth);     setProperty("Rst2" add i, _y, yposition);     Rst2.Rst2 = Rst2_array[1];     set("Rst2" add i add ".info", Rst2_array[i]);     depth--;         // Rst3     duplicateMovieClip(Rst3, "Rst3" add i, depth);     setProperty("Rst3" add i, _y, yposition);     Rst3.Rst3 = Rst3_array[1];     set("Rst3" add i add ".info", Rst3_array[i]);     depth--;             // Rst4     duplicateMovieClip(Rst4, "Rst4" add i, depth);     setProperty("Rst4" add i, _y, yposition);     Rst4.Rst4 = Rst4_array[1];     set("Rst4" add i add ".info", Rst4_array[i]);     depth--;         // Set the y position plus 30     yposition = yposition+10; }

Rst4 is the column that displays the filenames and as previously mentioned I need this to be a 50px x 50px thumbnail instead.

many thanks in advance for any help or guidance.

Cheers Rob.
robm_01 is offline   Reply With Quote
Old 07-10-2005, 10:58 AM   #2
Registered User
Join Date: Jul 2004
Posts: 36

I am building a flash version of my current asp/html site http://www.imagerealm.co.uk/search_gen.asp

so the previous message is to try and display the thumbnails like the link shown.

any ideas?

Cheers Rob.
robm_01 is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 07:49 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.