randomizing images in a folder

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: randomizing images in a folder

Post by Mark » Fri Jul 11, 2014 11:08 pm

Hi,

For debugging, it might be useful to add the following before setting the filename:

Code: Select all

if there is no file myFilename then
  beep
  answer error "Can't find file" && myFilename
else
  set the filename of img 1 to myFilename
end if
if this still doesn't give you a clue of what's wrong, you might want to post your own script here. Of course, you'll need to make sure that there is an image control on the card where you want to display the image and if the image isn't on the current card, you have to refer to that card:

Code: Select all

  set the filename of img 1 of cd "Some Card" to myfilename
Note that if you want to display one image on many cards, you can create a button, group the button and set its icon to the id of your image control.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply