Page 1 of 1

loading image

Posted: Fri Jul 05, 2013 5:43 am
by michaelpicard
hi
Many may seem this is a stupid question but still I have been searching and it seems there are not any really beginner tutorials out there. I am looking for something simple but cannot figure it out. How do I have it load an image instead of text when I click a button??

Re: loading image

Posted: Fri Jul 05, 2013 6:28 am
by michaelpicard
come on , you're telling me nobody knows this? or you just don't want to help?

Re: loading image

Posted: Fri Jul 05, 2013 6:30 am
by Dixie
Have a look at the attached... it will get you started, but also read up on defaultFolder... so you can point liveCode to the directory where your images are...

(Of course people want to help... you will find lots of help on this forum... but here in England 06h30 in the morning is time for tea, cornflakes and getting to the bathroom before my daughters or else I will have to wait forever to have a tinkle.. :-) )

Re: loading image

Posted: Fri Jul 05, 2013 6:39 am
by michaelpicard
that doesn't answer the question
I want to have an image load on click of a button. simple not get an image after selecting

Re: loading image

Posted: Fri Jul 05, 2013 6:41 am
by Dixie
Oh well.. pray tell me where this image is located you want to load ?

Re: loading image

Posted: Fri Jul 05, 2013 6:46 am
by Simon
Oh well.. pray tell me where this image is located you want to load ?
Ha!

michael,
Try a bit harder.

Simon

Re: loading image

Posted: Fri Jul 05, 2013 6:49 am
by Dixie
Does this help ?...

Re: loading image

Posted: Fri Jul 05, 2013 6:55 am
by michaelpicard
the same folder that the file is saved in. I have tried changing the folder name to library, images etc. I can get text to load but what is the "language" to load an image is never answered. I find website programming easier than this even though I was told this is easier.
the actual image is : My documents/live code training/images/canada1.png

Re: loading image

Posted: Fri Jul 05, 2013 7:13 am
by Dixie
I humbly suggest that you do a little RTFM... try starting with the 'User Guide' page 322 under the heading 'What is a file path ?', it will lead you gently through how to point liveCode to the directory that has your image inside it... then

Code: Select all

 set the filename of image 1 to "the filepath where your image is located"

Re: loading image

Posted: Fri Jul 05, 2013 12:02 pm
by Klaus
Michael,

do yourself a favour and check these stacks to get the very basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html

Re: loading image

Posted: Fri Jul 05, 2013 9:02 pm
by michaelpicard
hi
thanks for all the help, I went too fats in trying different things while reviewing the tutorial videos and reading the users guide.
I finally got the answer from Dixie on her second post.
what I was looking for was how to say: put, place set image. if that makes sense.
on mouseUp
set the filename of image 2 to "canada1.jpg"
end mouseUp
so the answer was "set the filename" and that is what I was looking for as I could not find that wording anywhere. I usually catch on better with programming but this left me frustrated.
I will take my time and proceed slowly from now on.
Michael