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

Using effects between cards


LiveCode allows us to use visual effects between cards. There are several transition effects that can provide your app with a desirable visual effect.

How to do it...

To use effects between cards, follow the given steps:

  1. Create a new main stack.

  2. Change the name of the stack's card to Blue.

  3. Add a second card and name it Red.

  4. Change the background color of the Blue card to blue.

  5. Change the background color of the Red card to red.

  6. Drag a new button to the Blue card.

  7. Add the following code to the new button on the Blue card:

    on mouseUp
      visual effect dissolve
      go to card "Red"
    end mouseUp
  8. Add a button to the Red card.

  9. Add the following code to the new button on the Red card:

    on mouseUp
      visual effect push up
      go to card "Blue"
    end mouseUp
  10. Run the app in the simulator to see the results.

How it works...

To implement visual transitions between cards, we use the following syntax:

visual effect <effect>
go to card <card>

When we call the visual effect command, we are telling...