chose in scrolling field to go to another card

101 Views Asked by At

enter image description here

good day I need to chose from scroll field and it go to it own card the code I write always go to card "geely_km" even I chose "choice 2 "

2

There are 2 best solutions below

1
dunbarx On

If you lock the text of the scrolling field, then the text of any line you click on can be extracted:

on mouseUp
go card the clickText
end mouseUp

So if you have the names of the cards in that field, then clicking on any line will navigate to the card of interest

0
Devin On

The easiest and most common way to do this in LiveCode to create a list-style field. Do it in either of these two ways:

  1. Drag a Scrolling List Field object from the Tools palette to your card. scrolling list field
  1. If you already have a field on your card, open its property inspector and tick the Lock Text and List Behavior properties.

Once your list field is created, enter the names of the cards, one per line, in the list.

Script the list field like this:

on mouseUp
   go card the selectedText of me
end mouseUp

As long as the names of the cards and the names in the list match exactly, this will work.