Buttons

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
RJStriplin
Posts: 3
Joined: Sat Feb 20, 2016 11:27 pm

Buttons

Post by RJStriplin »

Hello, i was not sure where to post this, but i have a question about coding in livecode. Is there away to make a button affect a container on a different card.
for example:
Mouse up
put "Hello" into Container "hi"
end Mouse Up"
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Buttons

Post by FourthWorld »

RJStriplin wrote:Hello, i was not sure where to post this, but i have a question about coding in livecode. Is there away to make a button affect a container on a different card.
for example:
Mouse up
put "Hello" into Container "hi"
end Mouse Up"
Yes, just include the card reference as part of the field object specifier, e.g.:

Code: Select all

put "Hello" into field "hi" of cd "SomeOtherCard"
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
RJStriplin
Posts: 3
Joined: Sat Feb 20, 2016 11:27 pm

Re: Buttons

Post by RJStriplin »

FourthWorld wrote:
RJStriplin wrote:Hello, i was not sure where to post this, but i have a question about coding in livecode. Is there away to make a button affect a container on a different card.
for example:
Mouse up
put "Hello" into Container "hi"
end Mouse Up"
Yes, just include the card reference as part of the field object specifier, e.g.:

Code: Select all

put "Hello" into field "hi" of cd "SomeOtherCard"
I thought it might be something like this, but i was unclear how to go about doing it.
Thank you so much for your help.
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Buttons

Post by FourthWorld »

Happy to be of service.

If you need to you can even get and put data in fields of other stacks:

Code: Select all

put "hello" into field "somefield" of cd 1 of stack "someotherstack"
LiveCode is very flexible.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Buttons

Post by Klaus »

Hi RJStriplin,

1. welcome to the forum! :D

2. Please check these stacks to understand the basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html


Best

Klaus
Post Reply