Book Image

LiveCode Mobile Development Beginner's Guide

By : Colin Holgate
Book Image

LiveCode Mobile Development Beginner's Guide

By: Colin Holgate

Overview of this book

LiveCode is a tool for developing mobile apps designed for those who don't want to use Objective-C, C++ or Java. Although it is a tool full of rich features to create apps it can be challenging to get beyond the basics and build interactive and fun apps. Using this book, you can develop various apps and this book guides you through "till you upload the apps in the appstore."LiveCode Mobile Development Beginner's Guide" will explain how to create applications with the easiest, most practical cross platform framework available, Livecode Mobile and upload the apps to the appstore with minimal effort.Throughout the book, you'll learn details that will help you become a pro at mobile app development using LiveCode. You begin with simple calculator application and quickly enhance it using LiveCode Mobile. Start by learning the interface controls for videos and images of LiveCode's environment. Dig into configuring devices, building user interfaces, and making rich media applications, then finish by uploading the mobile applications to App Stores. You will learn how to build apps for devices such as iPhone, Android with the recently developed LiveCode Mobile through sample applications of increasing complexity.
Table of Contents (16 chapters)
LiveCode Mobile Development Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – making and navigating between cards


A calculator doesn't really need a title screen, but we'll make one anyway, in order to practice adding scripts and doing some basic navigation. You can either take your cleared-out stack from earlier, or start a New Mainstack from the File menu.

  1. Select New Card from the Object menu.

  2. Use the View menu to either go to the previous card (Go Prev), or first card (Go First).

  3. Make sure you have the Edit tool selected in the Tools palette, and drag a Label field to the middle of the card window. In this case you can easily see which one is the Label field (it says Label: in the icon), but as a general tip, you can point to controls in the Tools palette and see a help tip that shows what kind of control it is.

  4. In the Basic Properties section of the Inspector palette, uncheck the Don't wrap check box.

  5. Type title into the Name entry field.

  6. Choose Contents from the Inspector drop-down menu, and replace the initial text that says Label: by typing Simple Calculator into the contents entry field.

  7. Choose Text Formatting from the drop-down menu, and click on the align text center button, which is the middle of the three Align buttons.

  8. Change the Font, Size, and Style options, to make a nice looking title, resizing the field itself until you like how it looks:

  9. Drag a Push button (the second icon from the top left-hand side in the Tools palette) from the Tools palette, and place it below the title field.

  10. In the Inspector, choose Basic Properties from the drop-down menu (it's the menu that says Text Formatting in the screen shot above), type in Begin into the Name entry field. LiveCode will automatically show the same text as the button's label, even though you didn't type it into the Label entry field.

  11. You can go into the text formatting options for buttons too, if you wish!

  12. Mentally prepare yourself - we're about to type in our first script!

  13. With the button selected, choose Object Script from the Object menu. You can also right-click on the button itself, and select Edit Script.

  14. The Script window will appear, and will show a starter script, of on mouseUp, (empty line), and end mouseUp as shown in the following screenshot:

  15. Complete the script by typing in go next into the blank line to give you this final script:

    on mouseUp
    go next
    end mouseUp
  16. Close the script window, and click on Yes when asked if you want to save the changes.

  17. Choose the Browse tool from the Tools palette (the upper left-most tool, that looks like a regular cursor arrow), and click on the Begin button that you just made. All being well you're now looking at a blank card. Don't worry, you didn't just delete the title field and button! You're now on the second of the two cards that you made earlier. Use the View menu again to go back to the first card, to try the button again.

  18. Save! From the File menu, choose Save, and save the stack, with the name Simple Calculator, somewhere you can easily find later. Perhaps you could make a folder to hold the stacks you will make while reading this book.

What just happened?

That may have seemed like a lot of steps, but we did create the two cards we need, laid out a nice looking title field, and created a Begin button with its own script. In reality those steps take under two minutes, and even less as you gain experience in LiveCode.

Pop quiz – best name?

If you want to make it big in the multimedia authoring tool world, which of these names would be a bad choice?

  1. Henry

  2. Bill

  3. Bob

  4. Kevin