Question about hyper linking from Text field

Klaus Major klaus.major at metascape.org
Fri Sep 13 09:46:01 CDT 2002


Hi James,

> Klaus
>
> how do I do this?

hey, found an old question mark ? ;-)
Sorry for that joke, but i can never resist...

>> 1. You can create 120 buttons, arrange and group them
>> and add a scrollbar to that group.

Well, just do it :-)

Here's how:

Solution with lotsa buttons:

1. Create all buttons and set their names to the names of the cards
the buttons are supposed to navigate to.

If you like you can set the labels of the buttons to something
different thatn the names of the cards...

2. Arrange the buttons on a card, select all of them and group them.

3. Check "Horizontal Scrollbar" and/or "Vertical Scrollbar" in the 
"Group"-Tab
of the property-palette, resize/adjust that group

4. Then check the "lock location and size" on the "Basic"-Tab for that 
group.

5. Give the group this script:

on mouseup
  if the owner of the target is not me then exit mouseup
  if there is a card (the short name of the target) then
      go card (the short name of the taget)
  end if
end mouseup

So the group handles the mouseclick, checks what button
has been clicked and takes the name of the clicked button
to decide what card to go to.

That's all...

>> 2. You can set up a field (with TABS etc...) with all the names
>> of the card that are supposed to be navigated to.
>> Then you could format these names in the text as "Linktext" and
>> put this script into the field:

Solution number 2:
Here you have again 2 options ;-)

The first one:
If you want to display more than 1 cardname in a line of the field:

Create a field and type in all the names of the cards you want to
navigate to. Maybe 3 in a line separated by TAB.

Then you have to select each name in that field
and set its style (Menu "Text") to "Link".

Then put this into the script of that field

on linclicked the_link
     if there is a cd the_link then
        go cd the_link
     end if
end linkclicked

Second option:
You want all the cardnames in a separate line.

In this case create a "Listfield" and type the names into that field 
line by line.

After that give the field this script:
(A bit more simple that the solution of Mitchell-San ;-)

on mouseup
   it the selectedtext of me is empty then exit mouseup
   if there is a cd (the selectedtext of me) then
    go cd  (the selectedtext of me)
   end if
end mouseup

That's it...

Good luck ;-)

Drop another line, if you need more help...


Regards


Klaus Major
klaus.major at metascape.org

P.S.
I got used to doublecheck everthing first.
You may not need to use the if...then statements at all.
But they wont hurt ;-)




More information about the use-livecode mailing list