O'Reilly logo

LiveCode Mobile Development Beginner's Guide by Colin Holgate

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – setting up touch events

The handlers so far have all been in the card script, the plan being to have different cards with different types of puzzle. The interactivity handlers can be placed in the stack script, available to all of the cards.

  1. Open the stack script. There is only one global variable that we also need in the stack script, but there are a couple of initializing items to cover. Start the stack script with these lines:
    global snapdistance
    
    on preopenstack
       if the platform contains "iphone" then iphoneUseDeviceResolution true
    end preopenstack
       
    on openstack
       set the compositorType of this stack to "Static OpenGL"
    end openstack
  2. The preopenstack handler checks if the app is on iPhone, and requests that the device's native resolution ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required