put a link on each line of field

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
problème
Posts: 77
Joined: Fri Oct 23, 2015 12:03 am

put a link on each line of field

Post by problème »

Hello

I want to know how to make each line of a field be a link .
when I click on the line 1 of the field , I want to do something, click on the line 2 , do another thing , ...
Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: put a link on each line of field

Post by Dixie »

Mmm... well, to easily do what you wish you could use a list field and determine the line that is clicked... put something like this in the script of the field...

Code: Select all

on mouseDown
   switch (word 2 of the clickline)
      case 1
         answer the long time
         break
      case 2
         answer the long date
         break
   end switch
end mouseDown
Attachments
Untitled 1.livecode.zip
(1.02 KiB) Downloaded 285 times
Klaus
Posts: 14326
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: put a link on each line of field

Post by Klaus »

Bonjour problème,

you really should work through the "Scripting Conference" stacks I mentioned in one of your earlier postings:
http://www.hyperactivesw.com/revscriptc ... ences.html

Maybe start with stack "Controls" which also handles LIST FIELDS among other basic LC things.


Best

Klaus
problème
Posts: 77
Joined: Fri Oct 23, 2015 12:03 am

Re: put a link on each line of field

Post by problème »

thanks for your help
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10105
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: put a link on each line of field

Post by FourthWorld »

In addition to list fields, you can also use a locked text field with HTML links, responding to the linkClicked message.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10510
Joined: Wed May 06, 2009 2:28 pm

Re: put a link on each line of field

Post by dunbarx »

What everyone said.

Also check out the "link" keyword and the "linkText" property. These give you a lot of control over what happens when the user clicks a chunk of text.

Craig Newman
Post Reply