O'Reilly logo

LiveCode Mobile Development Beginner's Guide by Colin Holgate

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – making the location card work

The Location card has three fields in it, for latitude, longitude, and a title for the location. The user could well type in the details manually, but if they happen to be at the location in question there's a button there to grab the location and to fill in the numbers automatically.

  1. Edit the script of the Set to Current Location button, and type in the following lines:
    on mouseUp mobileStartTrackingSensor "location", true put mobileSensorReading("location", false) into tLocation mobileStopTrackingSensor "location" set the itemdelimiter to comma if the number of items in tLocation = 3 then put item 1 of tLocation into field "latitude" put item 2 of tLocation into field "longitude" end if end mouseUp ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required