Book Image

LiveCode Mobile Development Beginner's Guide (2nd Edition)

Book Image

LiveCode Mobile Development Beginner's Guide (2nd Edition)

Overview of this book

Table of Contents (15 chapters)
LiveCode Mobile Development Beginner's Guide Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – setting up the Keepers card


  1. Go to the Keepers card and create a MobGUI button for Prev, Next, and Play Media. Make a MobGUI Multiline field and name it mediaURL. Be sure to uncheck the Auto delete option, so that it keeps the URL data when we change cards. Also uncheck the Editable option. You should now have something looking like the following screenshot:

  2. Add these lines to the mouseUp handler of the Prev button:

      if the number of this card is > 5 then
        go previous
      end if
  3. Add these lines to the mouseUp handler of the Next button. Note that - 1 is used since the last card is the MobGUI card:

      if the number of this card < the number of cards - 1 then
        go next
      end if
  4. Add this line to the Play Media button's mouseUp handler:

      showMedia the mgText of group "mediaURL"
  5. Select the four controls and Group them. Check the box that says Behave like a background. Name the group keeperbuttons.

  6. Edit the script of the new group. Add this refresh handler:

    on refresh
      set the...