Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying LiveCode Mobile Development Cookbook
  • Table Of Contents Toc
LiveCode Mobile Development Cookbook

LiveCode Mobile Development Cookbook

By : Dr. Edward Lavieri Jr.
3.5 (11)
close
close
LiveCode Mobile Development Cookbook

LiveCode Mobile Development Cookbook

3.5 (11)
By: Dr. Edward Lavieri Jr.

Overview of this book

If you are a LiveCode mobile developer looking to improve your existing skills, add efficiencies to your code, or want a better understanding of LiveCode’s capabilities, then LiveCode Mobile Development Cookbook is a must-have for you. The reader should at least have a basic understanding of LiveCode and mobile application development.
Table of Contents (12 chapters)
close
close
11
Index

Implementing a countdown timer


To implement a countdown timer, we will create two objects: a field to display the current timer and a button to start the countdown. We will code two handlers: one for the button and one for the timer.

How to do it...

Perform the following steps to create a countdown timer:

  1. Create a new main stack.

  2. Place a field on the stack's card and name it timerDisplay.

  3. Place a button on the stack's card and name it Count Down.

  4. Add the following code to the Count Down button:

    on mouseUp
      local pTime
       
      put 19 into pTime
      put pTime into fld "timerDisplay"
      countDownTimer pTime
    end mouseUp
  5. Add the following code to the Count Down button:

    on countDownTimer currentTimerValue
      subtract 1 from currentTimerValue
      put currentTimerValue into fld "timerDisplay"
      if currentTimerValue > 0 then 
        send "countDownTimer" && currentTimerValue to me 
          in 1 sec
      end if
    end countDownTimer
  6. Test the code using a mobile simulator or an actual device.

How it works...

To implement...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
LiveCode Mobile Development Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon