Create Link Label

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
warrenk
Posts: 110
Joined: Sun Sep 21, 2008 5:39 am

Create Link Label

Post by warrenk » Thu Oct 09, 2008 4:10 pm

Can I create a label that is a link? I created the label and on the card open....

set the textStyle of "Register" to link

...where Register is the name of the label. It is not working.

I am not sure if I can create a label as a link. Is this even possible?

Warren

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Oct 09, 2008 5:34 pm

You need to refer to the actual label field in your script. Also, it is a bit easier to set the textStyle of the field's content, and then its linkText.

Code: Select all

set the textStyle of char 1 to -1 of field "MyLabelField" to "link"
set the linkText of char 1 to -1 of field "MyLabelField" to "This is a Test"
Then you set the script of the label field to something like

Code: Select all

on linkClicked pLink
  answer pLink
end linkClicked
Now when you click on the label's linked text, you should get a message box with the text "This is a Test" and an "OK" button.

Hope this helped,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

warrenk
Posts: 110
Joined: Sun Sep 21, 2008 5:39 am

Post by warrenk » Thu Oct 09, 2008 8:55 pm

Jan,

I used your code and the link works great!

Thanks!
Warren

Post Reply