Page 1 of 3

Make Hyperlinks active

Posted: Sun Apr 10, 2016 10:53 am
by bbhank
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.

Re: Make Hyperlinks active

Posted: Sun Apr 10, 2016 11:13 am
by Dixie
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...

Code: Select all

on linkClicked pLink -- open the URL stored with the clicked text
    launch url pLink
end linkClicked

Re: Make Hyperlinks active

Posted: Sun Apr 10, 2016 3:36 pm
by dunbarx
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):

Code: Select all

on mouseUp
launch URL the clickText
end mouseUp
is another way.

Craig Newman

Re: Make Hyperlinks active

Posted: Sun Apr 10, 2016 4:05 pm
by FourthWorld
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.

Re: Make Hyperlinks active

Posted: Sun Apr 10, 2016 4:59 pm
by dunbarx
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

Re: Make Hyperlinks active

Posted: Sun Apr 10, 2016 6:46 pm
by bbhank
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

Posted: Sun Apr 10, 2016 6:58 pm
by Klaus
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.
:(
Please post your script(s) and where exactly you put them!

Re: Make Hyperlinks active

Posted: Sun Apr 10, 2016 9:57 pm
by bbhank
I used the scripts above and tried each of them in the stack as well as the link itself.
Exactly where do they go?

Re: Make Hyperlinks active

Posted: Sun Apr 10, 2016 10:02 pm
by Dixie
bbhank...

try this stack

Re: Make Hyperlinks active

Posted: Sun Apr 10, 2016 10:09 pm
by bbhank
The link in the zip file works. See original question. My links are from a database. Might that that part of the problem?

Re: Make Hyperlinks active

Posted: Sun Apr 10, 2016 10:16 pm
by Dixie
As Klaus said... 'Post your scripts"

Re: Make Hyperlinks active

Posted: Sun Apr 10, 2016 10:22 pm
by bbhank

Code: Select all

set the text of field "Link" of me to pDataArray["label 7"]
and

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?

Re: Make Hyperlinks active

Posted: Sun Apr 10, 2016 11:40 pm
by dunbarx
Ah.

I am always the last to know that the OP is either working with mobil, or with a dataGrid.

Craig

Re: Make Hyperlinks active

Posted: Sun Apr 10, 2016 11:50 pm
by bbhank
Datagrid. My oops. :oops:

Re: Make Hyperlinks active

Posted: Mon Apr 11, 2016 10:09 am
by Klaus
Sigh, baby steps... 8)

OK, now show us the bahaviour script of your datagrid,
that is where the "mouseup" stuff should go.