PDA

View Full Version : loading sound from database in Flash



toth
October 24th, 2005, 10:52 AM
Hello,

I'm working on a site that loads variables from a datase through ASP.
It's no problem to load a tekst in a dynamic text field.
Here's the code:

Loading variable from data.asp in Flash


loadVariablesNum("data.asp", 0, "GET");

data.asp file


<%
Dim rsAudio
Dim rsAudio_numRows

Set rsAudio = Server.CreateObject("ADODB.Recordset")
rsAudio.ActiveConnection = MM_flashASP_STRING
rsAudio.Source = "SELECT * FROM pageAudio ORDER BY ID ASC"
rsAudio.CursorType = 0
rsAudio.CursorLocation = 2
rsAudio.LockType = 1
rsAudio.Open()

rsAudio_numRows = 0

Response.Write "AudioTrack=" & Server.URLEncode(rsAudio("AudioTrack")) & "&AudioFile=" & Server.URLEncode(rsAudio("AudioFile"))

rsAudio.Close()
Set rsAudio = Nothing
%>

The table AudioTrack is the name of the audiofile
The table AudioFile is the adress to the mp3 file (ex. audio/sound01.mp3)

I can load the text in a dynamic textfield by giving it the variable AudioTrack
But how do I do it to load the mp3 sound file??

greetz, toth 8D