imageSource

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

imageSource

Post by Nakia » Mon Mar 12, 2012 10:10 am

Hi Again all,

what is the best way for me to do the following..

On my main card I need an image area which will display different graphics. I need to store these graphics on a card of an existing sub stack.
The trigger for the changing on the graphic will be using mouse up from some option buttons (located on the main card)

I have looked at the imageSource feature but cant seem to get the syntax correct.
I realize I am probably missing something really simple... :oops:

I have tried
--
set the imageSource of image/fld (tried both) "ImageArea" to "ImageName"
--
BTW, needs to be compatible with IOS

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

Re: imageSource

Post by Klaus » Mon Mar 12, 2012 1:01 pm

Hi Kia,

the dictionary entry is unambigious about this, you need to read more carefully!
...
Imagesource:
Specifies an image to be displayed in place of the specified character in a field.
...

Means:
...
set the imagesource of CHAR 1 OF FLD "XYZ" to "Name of image or ID"
...


Best

Klaus

Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

Re: imageSource

Post by Nakia » Mon Mar 12, 2012 9:00 pm

Okay so what would you suggest for me to achieve my goal?

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

Re: imageSource

Post by Klaus » Mon Mar 12, 2012 9:29 pm

Hi Kia,

after re-reading your post I think that using a field and imagesource might not be the best way for this!

I would create an image object on the card (image "display" in my example code) and then simply "putting"
any desired image from your substack into that image:
...
## Somewhere in your menupick/mouseup script of your option button
put img "the one in the substack" of cd 1 of stack "substack with images in it here..." into img "display"
...
Et voila, clean and fast :D


Best

Klaus

Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

Re: imageSource

Post by Nakia » Mon Mar 12, 2012 10:31 pm

Okay so when you say Image object you mean just drag an image area onto the card from the objects menu?

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: imageSource

Post by jmburnod » Mon Mar 12, 2012 10:37 pm

Hi Nakia
just drag an image area onto the card from the objects menu?
Yes. From the tool palette

Best

Jean-Marc
https://alternatic.ch

Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

Re: imageSource

Post by Nakia » Mon Mar 12, 2012 11:49 pm

Okay great thanks..
I will try this and report back if I have any issues

Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

Re: imageSource

Post by Nakia » Tue Mar 13, 2012 12:54 am

On a side note..

I have a variable which has a text file stored in it.. Can I search this variable for a specific string (which will come from another variable) and if it's found then place the line number of the found string into a another variable?

Hope that makes sense.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: imageSource

Post by sturgis » Tue Mar 13, 2012 1:02 am

Yes. Look at lineOffset() in the dictionary.
Nakia wrote:On a side note..

I have a variable which has a text file stored in it.. Can I search this variable for a specific string (which will come from another variable) and if it's found then place the line number of the found string into a another variable?

Hope that makes sense.

Post Reply