Image Download

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bsouthuk
Posts: 261
Joined: Fri Dec 05, 2008 7:25 pm

Image Download

Post by bsouthuk » Thu Jan 13, 2011 3:12 pm

Hi - wonder is someone out there can help me

I want my users to be able to select from a list field then click on a button for it to display an image on on the card. The image that is displayed will depend on the image they select from the list field.

I'm struggling to find a way of doing this - I want my images to be stored on my server as there are so many so if you have any ideas I would most appreciate it.

Thanks

Daniel

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Image Download

Post by Klaus » Thu Jan 13, 2011 3:22 pm

Hi Daniel,

since you can set the filename of an image to any valid internet URL, this should be prety easy!

This scripts presumes that the (bare) filenames of the images are in that listfield like "nice_image.jpg":

Code: Select all

on mouseup
  put the selectedtext of fld "listfield with imagenames" into tSel
  if tSel = empty then
    exit mouseup
  end if
  set the filename of img "your image for display here" to ("http://www.yourserverhere.com/folderwithimages/" & tSel)
end mouseup
Hope that helps.


Best

Klaus

bsouthuk
Posts: 261
Joined: Fri Dec 05, 2008 7:25 pm

Re: Image Download

Post by bsouthuk » Thu Jan 13, 2011 5:46 pm

Thats great, works perfectly - thanks Klaus!

Post Reply