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

Playing a movie


In this recipe, we will create a card that automatically plays an embedded movie when the card is loaded.

Getting ready

The sample.mov video file is provided on the book's website.

How to do it...

Follow the steps in this recipe to create the necessary controls that can play a movie using LiveCode:

  1. Create a new main stack in LiveCode with the following properties:

    • Height: 360

    • Width: 480

    • backgroundColor: Black

  2. Use the Standalone Application Settings dialog window and select the icon.
  3. Use the Add Files dialog box to upload the sample.mov file. Once this is done, your dialog window should look similar to the following screenshot:

  4. Close the Standalone Application Settings dialog window.

  5. Add the following code to the card:

    on openCard
      mobileControlCreate "player", "myController"
      
      mobileControlSet "myController", "filename", specialFolderPath("engine") & "/sample.mov"
      mobileControlSet "myController", "visible", true
      mobileControlSet "myController", "rect", "1,1,481,361...