Page 1 of 1

inserting and removing images from card...

Posted: Wed Feb 12, 2014 12:19 am
by tjo
I'm a noob and did search the forums before posting, any help is appreciated...

I am trying to create a simple quiz type game that requires me to insert and remove various images from a card.

I tried adding a blank image field to my card and then using something like

Code: Select all

put "./imagefolder/image.png" into field "ImageField" 
Hoping it would insert the image, however this did not work. I played around with the file path a bit, but had no luck.

I also tried adding the image to the card manually then setting the visibility to true/false when I need the image to appear/disappear. I am not sure if this is a good practice to use as I will be using up to 100 different images. I tried

Code: Select all

set the visible image of "ImageField" to false
however it did not seem to work for me.

Thanks in advance to anyone who can offer advice,

TJ.

Re: inserting and removing images from card...

Posted: Wed Feb 12, 2014 1:01 am
by Simon
Hi TJ,
Welcome to the forum :)

Here is the lesson:
http://lessons.runrev.com/s/lessons/m/4 ... ing-images
The bit you want is
"set the filename of image ..."
Lookup filename in the dictionary as well.

Simon

Re: inserting and removing images from card...

Posted: Wed Feb 12, 2014 1:16 am
by tjo
Thank you very much Simon. I actually skimmed over that lesson but must have missed the set filename part. It worked right away.

Thanks again,

TJ.

Re: inserting and removing images from card...

Posted: Wed Feb 12, 2014 12:24 pm
by Klaus
Hi TJ,

1. welcome to the forum! :D

2. I recommend to work through these stacks to get the basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html

And please take the LC objects as they are (at least when beginning :D ) !
FIELD = TEXT!
IMAGE = IMAGE 8)
etc...


Best

Klaus