inserting and removing images from card...

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

Post Reply
tjo
Posts: 16
Joined: Wed Feb 12, 2014 12:08 am

inserting and removing images from card...

Post by tjo » Wed Feb 12, 2014 12:19 am

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.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: inserting and removing images from card...

Post by Simon » Wed Feb 12, 2014 1:01 am

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

tjo
Posts: 16
Joined: Wed Feb 12, 2014 12:08 am

Re: inserting and removing images from card...

Post by tjo » Wed Feb 12, 2014 1:16 am

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.

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

Re: inserting and removing images from card...

Post by Klaus » Wed Feb 12, 2014 12:24 pm

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

Post Reply