Remember that you can only send text or string from a db to AS and not the “content” of a graphic file nor mp3. However, there is one thing that you can send, and it’s the filename.
In your db, you should have at least these two columns :
id | mp3name
for example, you could have a row looking like this :
id = “btnAblaEspagnol”
mp3name = “espagnol.mp3”
Put in the id column a unique identifier - a number, a string, whatever. This value will be assigned to your unique button (see below).
Suppose that in your flash movie, the user has to click on a button (and there is one button for each sound).
Depending on the structure of your file, you could put a variable in your root and put something like this :
[AS]on(Click){
_root.btnpressed = btnAblaEspagnol;
}[/AS]
The variable btnpressed will contain “btnAblaEspagnol”. Now, fill your LoadVars variable with this value :
[AS]infoSending = new LoadVars();
infoReceived = new LoadVars();
infoSending.btn = btnpressed;
infoSending.sendAndLoad(“url.asp”, infoReceived);[/AS]
This will send the value of the button to your ASP file and catch the filename to you will send back (from ASP to AS) in the variable infoReceived.
Now in ASP, fetch the value of the environment variable “btn”. Use it to query your db.
Query your db in order to get the mp3name where id is equal to the value of btn. I don’t know how to do it in ASP, so you’re on your own for that part.
When you have the value of the filename in a variable, shoot it in the output of asp with the function “echo” (or the function available in asp that do the same thing). Something like :
echo “mp3filename=” + var_name_having_mp3name_value;
Adapt this line of code to the standard of the ASP language.
You should now be able to read the filename in the variable :
infoReceived.mp3filename
You now just have to load your mp3 the way that you want. By adding a new column to your db, you could also store the swf filename and query the same way your db.
Hope this help.