I’m making an interactive map of a local state park. I will be taking lots of pictures in the park, and I want to use them in the map. Thing is, loading a bunch of pictures into flash is going to make it run really slow. SO, I wonder if there is a way to pull them in (on demand ONLY) from an external file or database.
Another option that you may consider is calling the images from a directory on a IIS server. This will eliminate the need for you to insert the pictures into the database each time you update or acquire new photos. All you need to do is dump any new photos into the directory and let flash do its thing.
For example. what I have done in the past is call the following asp code from Flash. The ASP code will create a string of all of the photos from the directory delimited by a comma. Once in flash I’ll create a array: var PhotoArray= PhotoList.split(",");
Variable photolist will have my string of photos in Flash.
Thats it!
Dim sVirtualPath, sServer, sPhotNames, iCntr
sVirtualPath= “/images/myphotos/”
sServer= MyServer"
sPath= Server.MapPath(sVirtualPath)
Set fs = CreateObject(“Scripting.FileSystemObject”)
Set sImages = fs.GetFolder(sPath)
sPhotoNames=""
iCntr=0
For Each sFile In sImages.Files
sPhotoNames= sPhotoNames & sFile.Name & “,”
iCntr= iCntr + 1
Next
If iCntr <> 0 Then 'Remove the last comma from the string
sPhotoNames= Mid(sPhotoNames, 1, Len(sPhotoNames)-1)
End If