Make Hyperlinks active
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Make Hyperlinks active
I have a field populated by query that is a link to website. I have followed the "tutorials". The field shows it is a link - underlined in blue. Whether locked or unlocked it can't be clicked on. What else needs to be done? Searches both inside and outside Livecode for workable answers gave nothing.
Last edited by bbhank on Sun Apr 10, 2016 6:10 pm, edited 1 time in total.
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Make Hyperlinks active
look at linkclicked in the dictionary.. for example, the handler below was placed in the stack script...
In the text of a fld , i put "http://www.bbc.co.uk" and made the address a link... lock the text of the field...
In the text of a fld , i put "http://www.bbc.co.uk" and made the address a link... lock the text of the field...
Code: Select all
on linkClicked pLink -- open the URL stored with the clicked text
launch url pLink
end linkClicked
-
- VIP Livecode Opensource Backer
- Posts: 9665
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Make Hyperlinks active
Hi.
I never looked at a lesson, but did it really leave you hanging without a way forward?
What Dixie said, and also you might know that (assuming the field is locked):
is another way.
Craig Newman
I never looked at a lesson, but did it really leave you hanging without a way forward?
What Dixie said, and also you might know that (assuming the field is locked):
Code: Select all
on mouseUp
launch URL the clickText
end mouseUp
Craig Newman
-
- VIP Livecode Opensource Backer
- Posts: 9838
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Make Hyperlinks active
The benefit of the linkclicked message is that it only triggers when clicking on text with a link style, whereas mouseup will trigger for all mouse activity within the field, outside of link text and even outside of any text at all if the field is larger than its contents.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 9665
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Make Hyperlinks active
Richard.
Good point. And I suppose that validating the style of the clickText would require an extra step.
I guess I was more interested in suggesting a basic technique than thinking through the issues.
Craig
Good point. And I suppose that validating the style of the clickText would require an extra step.
I guess I was more interested in suggesting a basic technique than thinking through the issues.
Craig
Re: Make Hyperlinks active
Tried each of the suggestions, including dictionary. None work so far. What's missing here? Tried each in both the stack script and field script.
Re: Make Hyperlinks active
Please post your script(s) and where exactly you put them!bbhank wrote:Tried each of the suggestions, including dictionary. None work so far. What's missing here? Tried each in both the stack script and field script.
Re: Make Hyperlinks active
I used the scripts above and tried each of them in the stack as well as the link itself.
Exactly where do they go?
Exactly where do they go?
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Make Hyperlinks active
bbhank...
try this stack
try this stack
- Attachments
-
- Untitled 1.zip
- (1.6 KiB) Downloaded 216 times
Re: Make Hyperlinks active
The link in the zip file works. See original question. My links are from a database. Might that that part of the problem?
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Make Hyperlinks active
As Klaus said... 'Post your scripts"
Re: Make Hyperlinks active
Code: Select all
set the text of field "Link" of me to pDataArray["label 7"]
Code: Select all
set the textStyle of field "Link" to link
The second code was sent using the message box as per instruction in tutorial at http://lessons.livecode.com/m/4071/l/74 ... -in-fields. This made it look like an active link but wasn't clickable.
The field gets its information from the Row Behavior, which is the first line of code above.
Does this help any?
-
- VIP Livecode Opensource Backer
- Posts: 9665
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Make Hyperlinks active
Ah.
I am always the last to know that the OP is either working with mobil, or with a dataGrid.
Craig
I am always the last to know that the OP is either working with mobil, or with a dataGrid.
Craig
Re: Make Hyperlinks active
Datagrid. My oops.
Re: Make Hyperlinks active
Sigh, baby steps...
OK, now show us the bahaviour script of your datagrid,
that is where the "mouseup" stuff should go.
OK, now show us the bahaviour script of your datagrid,
that is where the "mouseup" stuff should go.