all groups > flash data integration > april 2007 >
You're in the

flash data integration

group:

load image from SQL database with ASP?


load image from SQL database with ASP? Michealnl
4/13/2007 12:00:00 AM
flash data integration: Hello,
Does anyone know a tutorial where you can load an image from a SQL database ?
I would like to show this image in Flash, but i don't know how to load in from
a SQL database using ASP.

Regards,

Micheal
Re: load image from SQL database with ASP? MotionMaker
4/13/2007 6:17:55 PM
Flash cannot load images from an SQL database.

Flash can load JPEG, PNG, GIF, SWF, MP3, and FLV files.

An SQL database can be used to store the file names and their location. ASP
can retrieve that data from the SQL and return to Flash to load the above file
formats.

For Flash to do the communication with ASP you need to determine if you are
using URL Encoded or XML data structures.

For URL Encoded data you look at
http://livedocs.macromedia.com/flash/8/main/00002336.html
For XML Encoded data you look at
http://livedocs.macromedia.com/flash/8/main/00002879.html

Then in their onLoad methods you use
http://livedocs.macromedia.com/flash/8/main/00002479.html to load JPEG, GIF,
PNG and SWF; http://livedocs.macromedia.com/flash/8/main/00002677.html for MP3,
http://livedocs.macromedia.com/flash/8/main/00002551.html for FLV.
Re: load image from SQL database with ASP? rhythm123
4/16/2007 6:42:10 PM
I think you can actually do this by creating an asp image page that streams out
the required image. In flash you would have your container point to the url of
the asp image page with a parameter. The parameter will be used by your asp
page to determine what image in the database to display. Your flash instead of
pointing to an image file will point to this url with the respective parameter.
As long as the asp page does its job, flash will not know that its a substitute
and not an actual jpg, gif, png, swf file etc. Make sure that the page outputs
nothing else but the headers and response.binarywrite data and you should be
cooking with grease.

Sean

Reference:
An ASP Database image streaming method.
http://www.ammara.com/support/samples/code/viewcode_eb67.html
AddThis Social Bookmark Button