Book Image

LiveCode Mobile Development Cookbook

By : Dr. Edward Lavieri
Book Image

LiveCode Mobile Development Cookbook

By: Dr. Edward Lavieri

Overview of this book

Table of Contents (17 chapters)
LiveCode Mobile Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Displaying web pages in your app


If you need to display a live web page in your mobile app, then this recipe is for you. In this recipe, you will learn how to create a display area in your app, retrieve web data, and display that data.

How to do it...

Follow these steps to display web pages in your app:

  1. Create a new main stack.

  2. Select the stack's card and drag an image area to display the web information.

  3. Select the image and then select the Group icon on the toolbar to make the image a group.

  4. Select the group and set the following properties:

    • Name: Browser

    • Width: 312

    • Height: 390

    • Location: 160, 225

  5. At the card level, enter the following code:

    local browserID
  6. Create a preOpenCard handler with the following code:

      on preOpenCard
        mobileControlCreate "browser"
        put the result into browserID
        mobileControlSet browserID, "visible", \
              "true"
            mobileControlSet browserID, "url", \
              "http://www.packtpub.com"
          end preOpenCard

    Note

    The preOpenCard message is sent to...