Neat LinkClicked tip...

Chipp Walters chipp at chipp.com
Tue Apr 18 02:51:47 EDT 2006


???

Jerry Daniels wrote:
> Chipp,
> 
> Sorry i'm late with this comment, but I said "the textStyle of the  
> clickChunk" or clickCharChunk. If you've used clickCharChunk earlier  in 
> the handler, i believe you have to use something like  mouseCharChunk or 
> mouseChunk.

Not sure I understand.

The clickCharChunk only returns the position of the character clicked 
whereas the clickText returns the word, or in case of linked text, the 
WORDS clicked on.

So, it makes it really easy to contstruct switch statements, as all you 
need to check for is the entire group of words in the linkedText.

The code below, when inserted in the script of a locked field, works 
fine (at least on WinXP, and I assume on Mac OSX).

-Chipp

>> on mouseDown
>>   if the textstyle of the clickText is "link" then
>>     --> DO LINKCLICKED STUFF HERE
>>     answer the linkText of the clickText
>>   end if
>> end mouseDown




More information about the use-livecode mailing list