Scrolling two overlying & see-through fields?

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
Maxiogee
Posts: 38
Joined: Thu May 05, 2011 5:45 pm

Scrolling two overlying & see-through fields?

Post by Maxiogee » Sat Nov 12, 2011 10:53 pm

A scrolling field (field "ListAns") contains a list of numbers from 1 to 100 (one per line), some in red and some in black.
Overlying this field is another (field "UserAns") which non-opaque and into which the program will enter solutions a user generates [in a different field … put field "Solution" into line (first word of field "Solution") of field "UserAns"] for some of these numbers - the black ones. The red ones are there to show the user they do not need to find answers to match these numbers.

The text in field "UserAns" will be blue. The user will know by looking through the field which answers they have yet to generate, as their blue text will mask the original black. In the stack's many cards the red numbers will vary from card to card.

How can I make the two fields scroll in tandem so that when the topmost field's scrollbar is moved, this is replicated in the lower field?

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

Re: Scrolling two overlying & see-through fields?

Post by Klaus » Sat Nov 12, 2011 11:32 pm

Hi Maxiogee,

put this into the script of the field "UserAns":

Code: Select all

on scrollbardrag
  set the scroll of fld "ListAns" to the scroll of me
end scrollbardrag
Et voila, they scroll "in sync" :D


Best

Klaus

Maxiogee
Posts: 38
Joined: Thu May 05, 2011 5:45 pm

Re: Scrolling two overlying & see-through fields?

Post by Maxiogee » Sun Nov 13, 2011 10:26 am

Thank you.

That was quick and painless.

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

Re: Scrolling two overlying & see-through fields?

Post by Klaus » Sun Nov 13, 2011 10:29 am

:)

Post Reply