Ok, here's my situation. I have this desire to create a Flash photo album and embed it in my website. I have an asp page that looks up a photo's file name, caption text, and album name. This is the asp code:
Set DataConn = Server.CreateObject("ADODB
.Connectio
n")
DataConn.Open "Driver=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("Photos.mdb
")
Set cmdTemp = Server.CreateObject("ADODB
.Command")
Set rstContacts = Server.CreateObject("ADODB
.Recordset
")
/*I realize I'm hard-coding the album for now, but I can change this later, once I get this working*/
cmdTemp.CommandText = "Select Pictures.*, Albums.AlbumName From Pictures INNER JOIN Albums ON Pictures.AlbumID=Albums.Al
bumID WHERE Pictures.AlbumID=2"
cmdTemp.CommandType = 1
Set cmdTemp.ActiveConnection = DataConn
rstContacts.Open cmdTemp, , 1, 3
rstContacts.Move CLng(Request("Record"))
Response.write "PicName=" & Server.URLEncode(rstContac
ts("PicNam
e")) & "&"
Response.write "PicCaption=" & Server.URLEncode(rstContac
ts("PicCap
tion")) & "&"
Response.write "AlbumName=" & Server.URLEncode(rstContac
ts("AlbumN
ame")) & "&"
Response.write "TotalRecords=" & rstContacts.RecordCount
rstContacts.Close
DataConn.Close
Then the asp page sends this information to a Flash swf file using the following lines:
onClipEvent(data)
{
//strCaption, strAlbum, strPicNumber are dynamic text fields, PicWindow is the instance name of a movie clip
strCaption = PicCaption;
strAlbum = AlbumName;
strPicNumber = "Picture " add String(CurrentRecord+1) add " of " add String(TotalRecords);
PicWindow.loadMovie("../Pi
ctures/"+A
lbumName+"
/"+PicName
);
}
onClipEvent(load)
{
CurrentRecord = 0;
loadVariables ("getdetails.asp?Record=0"
, this);
}
My two control buttons in the movie clip do the following:
//Prev Button
on (release)
{
CurrentRecord--;
if (CurrentRecord == -1)
CurrentRecord = TotalRecords-1;
loadVariables ("getdetails.asp?Record=" add String(CurrentRecord), this);
}
//Next Button
on (release)
{
CurrentRecord++;
if (CurrentRecord == TotalRecords)
CurrentRecord = 0;
loadVariables ("getdetails.asp?Record=" add String(CurrentRecord), this);
}
When I publish the swf file and use an html file to view it, I get the text properly. I get the picture name, album name, etc, and the navigation buttons get me the previous or next picture information correctly. The issue I have is that the image does not display at all. I can't get the movie clip named PicWindow to display the image correctly.
I want to use asp, and I want to use a database, so please consider that in your solutions.
Any thoughts?