field advice

André Bisseret andre.bisseret at wanadoo.fr
Fri Apr 11 05:36:14 EDT 2014


Le 9 avr. 2014 à 16:24, Michael Doub a écrit :

> ...

>   Is it possible to detect that an imagesource character has be clicked?   
> 
Michael,

It is possible with double clicked (selectionChanged);

In a field of one of my stacks, the user has the possibility to launch files from a folder "Documents" thanks to characters with an imageSource
each imageSource (invisible) has a customprop "the fileTitle"
In order to allow launching the file I use selectionChanged
Below is the handler (simplified)

on selectionChanged
    if word 1 of the selectedText is "#" then -- 
        select word 1 of the selectedChunk
        put word 2 of the selectedChunk into tCharNum
        put last word of the selectedChunk into tFieldNum
        if the imageSource of char tCharNum of fld tFieldNum is not empty then
    -- -- make the filepath
                set the itemDel to slash
                put the filename of this stack into tThePath
                put "Documents" into item -2 of tThePath
                put the fileTitle of img (the imageSource of char tCharNum of fld tFieldNum) into item -1 of tThePath
                launch document tThePath
         end if
   end if
end selectionChanged

Best regards

André






More information about the use-livecode mailing list