What is a handler in LiveCode

If you don't see a table of contents, please click here:
If you have looked at this lecture note before and want to be sure that you have the latest version, please clear the browser cache and reload the page.
If you want to see other topics, please click here: .

LiveCode (former name RunRev) is, in a sense, a successor product to Claris HyperCard from the 80s and SuperCard. Stacks of both old apps can be converted [10,11]. Apple's XCode. In contrast to the two mentioned, you can use LiveCode to make applications not only for the Mac, but also for Unix, Linux and Windows. The programming is event-driven and is reminiscent of the earlier versions of DirectorsLingo.

There are a number of plugins for the actual program. These must be in a folder called Plugins get saved. The folder in which this folder is located is specified under LiveCode> Settings> Files & Memory> User Extensions.

This lecture note requires a general, elementary understanding of programming.

When it comes to nouns, English terms are capitalized in German, but I prefer to write them in lower case when it comes to words from the vocabulary of the programming environment so as not to get used to anything wrong. Some programming languages ​​differentiate between xyz and Xyz, which leads to syntax errors that are difficult to detect.

1.1 architecture

A LiveCode is the electronic representation of a stack of index cards, the individual cards of which are designed and can also contain multimedia and interactive elements. The workflow is top-down. You start with a UI (window, palette ...), attach the objects of the interface and finally code the behavior of the application. LC contains 23 customizable interface objects such as buttons, text fields, menus, data grids, bitmap and vector graphics as well as multimedia players. You only have to drag these objects from the tool palette onto the map. The properties of an object can be set by double-clicking on it.

To create objects, simply drag them out from the Tools palette. To edit them, choose the pointer tool in the top right of the Tools palette and double click them to edit their properties.

First you have to create a stack (a deck of cards), the first stack created being the so-called Main stack is. It opens with a window. Every window, regardless of whether it belongs to a window, a palette or a dialog box, is a stack in LC. Each stack contains one or more Cards (Cards). They display the various images and information. Controllers such as buttons, checkboxes, etc. are dragged onto cards. By grouping controllers you can make them available for multiple cards. Background images can give a stack a uniform image.

Multiple stacks can become one Stack file can be summarized, whereby the stacks can be controlled as a function of one another. The first executing stack is the main stack. It can be more Substacks which have been generated accordingly. These can also be dialog boxes or palettes. If you save a stack of a stack file, all stacks are saved at the same time. Events that have not been processed by a substack go up to the main stack and the color and font properties of the main stack are inherited down to the substacks. The message path is shown as follows [1]:

In order to define a background as such in the message path, its backgroundBehavior property must be set to true in a script or the "Behave as Background" check box is ticked.

LC allows the use of a wide variety of media, whereby these can be played via the player contained in LC, or via QT, or via a 3rd party player, whereby QT covers a larger area of ​​media than the original player of the program. The internal player can play embedded media, the QT player can only play external media, which can also be streamed. For images, it's best to upload the originals to a single stack (a kind of image gallery) and then reference them as needed. On the other hand, parts of the application can be stored on a server and only called up when required with a URL command. The same applies to databases if it should be possible for them to be used by several users at the same time.

The wholeaddressable memory is 4GB on 32-bit systems.

1.2 General language aspects

The LC programming language is very similar to the older versions of Macromedia Directors Lingo and Apple's one-time HyperCard.

Comment lines are introduced with #. e.g .: # This is a comment. However, the prefixing of 2 hyphens known from Lingo also works
- That's a comment
A line break is shown with \. e.g .:
put listFiles ((pFolder & slash & tFolder), pRecurse) into \

A purchased license for LC makes it possible to see an overview of all purchased products on the home page under My account. They can be downloaded there and LC can be automatically authorized at startup. For products from third-party manufacturers, they provide an activation code (serial number). You have to be careful if you buy 2 or more products in a row without buying the 2nd as an add-on to the first. Then you have 2 different licenses, each of which can only do one (e.g. to make either Mac / Win standalone apps or only iOS apps). Every time you want to use the other option you have to unlicense LC (Help> Re-license LiveCode) and restart. When you restart, you switch to manual licensing and refer to the relevant license file for the relevant version. This file can be downloaded as a .lic file on the account page:

The working environment of the program looks something like this. There is a separate chapter for the application browser, which is not shown here.

A context-specific inspector can be called from the horizontal menu bar at the top left, a programming window (Code Window) and a Message box. The latter makes it possible to read things out during the execution of the stack process and also to enter commands in the manner of a command line tool. At the top of the tools palette there are two buttons for switching between the run and edit environment. The editing environment is used for programming and the app is run in run mode.


A detailed description of the various interface elements can be found in Chapter 4 of the user guide.

3.1 The tools window

The most important thing to understand the program flow are the two arrows in the tools window. If you click on the right of the two arrows, you are in Edit-Mode. In this state you can program the project, use and remove resources, etc.

If you want to see how the program runs, you click in the left of the two arrows and you will find yourself in the so-called run-Mode.


4.1 paths

When specifying Filenames There must be no space in between, or the designation must be enclosed in quotation marks. so

play audioclip Der_Ton.aif
play audio clip "Der Ton.aif"

4.2 Reading in and reading out files


The first element created in LC is a new one Stack (Mainstack) and its inextricably linked 1st card. Its properties are called up in the Object> Stack Inspector Stack Inspector displayed. There you can first set size & position in the pop-up menu. If you were to program in landscape format for an iPad 2, then that would be width: 1024px, height: 768px, for the successor model 2048 x 1536 px (at 264 ppi). With View> Rulers, rulers become visible on the sides. In the Stack Inspector (SI) there is a Controls field under Basic Properties. With its help you can see the properties of the Title Bars which only take effect when the stack has been closed and reopened. With an iPad programming you will z. B. select the last menu item Empty.

You can add more cards to the stack via Object> New Card. To navigate to a specific card, click in the Inspector on the triangle at the top right and continue with inspect> card> card ID xxxx. You can scroll back and forth with View> Go xxxxx.

5.1 The Application Browser (AB)

The architecture of a program is in Application browser pictured. With Tools> Application Browser you get a window in which you can see all opened stacks and the cards in them, as well as the elements on the cards.

The application browser has many very useful functions. The left side shows all open stacks and substacks. Double click on a stack or a card indicates this object. Double click on sound or video plays this object. The numbers in the column Num indicates the object number. Columns with the script symbol in the header enter the number of script lines for this card, stack, button, and so on Click on a column sorts them in ascending order. A Right click on the column header it is possible to insert additional characteristics. Right click on a stack, a card or a layer (right column) opens a context-sensitive object menu in which the refresh option is particularly interesting for layer objects. For more detailed explanations, see page 56f in [1]. alt double click opens the PI if it is not already open. cmd double click on a stack, a map or a layer the script window opens, which can also be done via right click> edit script. With cmd-click You can select these cumulatively on different layer objects. You can select an object in the right or left column by selecting its Type in name. The magnifying glass in the Right Header Bar enables objects on a map to be temporarily hidden.

If you have selected the LiveCode UI elements appear in lists of stacks checkbox in the LiveCode-> Settings-> General menu, you can see all stacks of the framework in addition to your own.

5.2 Put on a new stack

If you create a new main stack, it opens to a certain size. This size, as well as its position on the screen, can be set in the SI under Size & Position. You could also use a script like

on preOpenStack
local tRectangle
put the windowBoundingRect into tRectangle
put 200 into item 1 of tRectangle
put 200 into item 2 of tRectangle
put item 1 of tRectangle + 1024 into item 3 of tRectangle
put item 2 of tRectangle + 768 into item 4 of tRectangle
set the rectangle of me to tRectangle
end preOpenStack

can be used, for example, to always open the window with the upper left corner point to 200,200 and in the size 1024 x 768.

One generates a Substack (File> New Substack of ), then the Substack (are the Substacks) children of the main stack and inherit its properties. Conversely, messages that are not processed by the substack are also passed on to the main stack, so that code that is needed by several substacks is best placed in the main stack. Typical areas of application for substacks are, for example, combining all possible dialog boxes or the tool palettes of a program in a separate stack.

The title of the stack is the designation that also appears in the title bar of the application window. Scripts always refer to the name (the name property) of the window. You can look up both in the SI.

5.3 Cards

The characteristics of cards can be seen in the CI. Their order within the stack can be exchanged by changing the number (or, equivalent, the layer property). A number cannot be greater than the number of cards in a stack. The identification inextricably linked to the card is its ID. The progression (go next, go previous) is based on the number of the cards.

5.4 Controls

Controls are dragged onto the map from the Tools palette.


6.1 Insert a picture

Numerous image formats such as GIF, JPEG, PNG, BMP, XWD, XBM, XPM, or PBM, PGM, or PPM files are supported. PICT files can also be used on the Mac OS, but they are not displayed on Unix or Windows systems. It is best to use .png, but .jpg is also suitable. For use on computer screens, the resolution does not need to be greater than a normal screen resolution, i.e. 72 resp. 96 dpi. With iOS applications, you have to comply with the respective resolutions of the iPhone, iPod or iPad. The image is imported using File> Import as Control> Image File ... You can then make various settings in the Inspector. Once you have made the settings, it is important to fix them, otherwise the original status of the image will be restored when you switch to another card. To do this, go to Size & Position in the Inspector's pop-up menu and check Lock size and position. With Object> Move you can set the levels of several overlapping images [2]. If you want the image as the background of a map, you can adjust its brightness in the Inspector with the pop-up blending.

To reference an image file, go to File -> New Referenced Control -> Image file. Paint tools can only be used on images that are saved as control were imported.

6.2 Buttons

You can drag the usual buttons from the Tools window onto the map. There is a push button and a default button, but the two are the same and only differ in the preset basic properties in the PI. If you set the blend level of a button to 100, it becomes completely transparent, but still works as a button. You can also deselect show border. In this way you can have several Hot spots generate on an image.

If you want to use a button to navigate, you select it and then open the code window. There you can write a mouse event and combine it with go to the next or the previous card. If you want to jump to a certain card, you enter its id, which can be found in the AB. e.g .: go to card id 1025

Messages to the user can be sent with answer:

answer has a wide range of design options. In iOS, the most you can do is answer "msg" [with "button1" and "button2" ...] [titlted "window heading"]. The display of the window also looks different:

The last button in the row is always the default.


6.3 Text

Although there are a number of possible text fields in the tool window, these can be converted into one another, i.e. ultimately one and the same object.

6.3.1 Generating text

If you want to get text on a card, you draw one Label on them. The PI provides the option of entering text (Contents pop-up menu), as well as the design of the content. Note that the break in the content field of the PI, symbolized by the curved arrow, has nothing to do with the break in the label. This is controlled independently in the basic properties of the PI with the Don't wrap checkbox.

During a resize of the label field you can see its line spacing. This can be changed in the Text> Size ... menu. The maximum possible line spacing is 48. With Text> Size> Other ... you can enter values ​​other than the given values, but not greater than 48. Accordingly, no text generated in LC can be larger than 48.

Do you need one table, so you draw a basic table field on the .map. Again, the content is entered in PI> Contents. If you want to jump to the next column on the right, you give a TAB command. The new line of the table can be reached with a CR in the content field.

There is a ListMagic 1.1.4 plug-in from 2008 for creating lists, which could make creating lists much easier, but the trial version on MacOS 10.6.2 is not activated even after purchasing a license, which makes the software unusable.

6.3.2 Save and load

Save and / or load text fields

6.4 Drawing

There are two tool areas with which you can draw directly on a map:

6.5 Navigation

6.5.1 Top card

First of all, it is important that the correct card is on top when the stack is opened. This is the easiest to do with

on preOpenStack
go to card id
end preOpenStack

The 4-digit ID code of the relevant card must be used for .

However, you can also change the order in which the cards react to a go next command at a later date. You have to change either the number or the layer property in the CI. Both are connected to each other. The lower the number, the earlier the map appears when you scroll forward.

6.5.2 Scroll further, jump

First you need a graphic that, when clicked, redirects to another card. You can get something like that from the symbols of AI, for example. . Now you can either isolate a button with a screen, copy it and paste it on a card, or you can save the isolated AI image if you need a resolution higher than the screen resolution. If the background of the stack card is not white, any white border around the image must be made to disappear.This is achieved by setting the blending mode to transparent in the PI of the graphic. In the example shown above, however, this is not perfect, as the image itself also has white areas that make them transparent. You can now either color this area in the original image slightly gray and import the image again or use another blending mode that does not matter, such as blendMultiply. (Blend does not affect pictures in PICT format).

To give the button functionality, it is selected and a script is written:

on mouseup
go to card id 1002
end mouseup

If the button should simply lead to the next card, the corresponding command is called

go to next card

corresponding to the previous attribute if the previous card is to be navigated to. Occasionally it may be necessary to rearrange the cards beforehand to use a general term such as next and previous. Such general buttons may be placed on a background map (§).

User Guide: You can also group controls together if you want them to operate as a set. For example, if you
Have a set of navigation buttons that go from card to card in your stack, you can make them into
a single group. Groups can appear on more than one card, so your navigation buttons or
background image can appear on each card of your stack. For more details, see the section on
Group and Backgrounds.

If the button is to have a downstate, i.e. a Hilite when you click, you need a second image or you change the blending mode.

on mousedown
set the blend level of image id 1028 to 50
end mousedown

on mouseup
go to card id 1002
set the blend level of image id 1028 to 0
end mouseup

To be on the safe side, you still have to add a script, because if the user clicks on the button (mousedown) but then changes his mind and pulls out of the picture with the mouse button pressed, the original blend mode should be restored.

on mouseleave
set the blend level of image id 1028 to 0
end mouseleave

The effect of the mouseleave handler only occurs after releasing the mouse button.

A successful introduction to this topic can be seen in the iBand of the North Point Community Church in Atlanta, Georgia, USA.

The simplest sound is the system warning sound. It often helps with the control of a stack by inserting the command beep with n-fold repetition at test points (n = 1,2, ...)

on dealer
beep 3
end dealer

7.1 audio clip

Sound can be imported or linked. If you import a sound, it resides in the stack and takes up space accordingly. To do this, it is immediately loaded with the stack and is always ready to hand. Such an imported sound is called one audio clip. The sound files should be in the form of .aif or .aiff. .Wav and .au also work, but .mp3 cannot be used. An incomparably larger number of audio formats can be played with the player

You select the card to which you want to import and import as usual via File> Import as Control> Audio File ... Then you drag a button on the card, define your attributes in the PI and click the code tool. You can then attach a script to the button as follows:

on mouseUp
- play audioclip MeinSound.aiff
end mouseUp

When an audio clip plays, a temporary player is created. When the clip starts playing, a playStarted message is sent to it.
I have seen that an .aiff file that I pulled down from a CD did not play properly, it just made noise. After opening the sound file in Audacity and saving it as .aiff, this file was then playable. I do not yet know the reason for this behavior, but I suspect that the file from the CD had some disturbing feature that was automatically eliminated by opening and exporting in the audio program. Although both situations were .aiff files, .aiff is not created equal.

if you want to stop the sound:

play stop for desktop systems, for iOS the command is: play empty

A command to play an audio clip stops a sound that is already playing and the card receives a playStopped message. It is also not possible to queuing sounds. If you want to check whether a sound is playing or not, you can do that sound Use function:

if the sound is done then
play stop or play empty for iOS
end if

If you want to set the volume for an audio clip , this is done between the values ​​0 to 100, e.g. for the value with

set the play Loudness of audioclip to

7.2 The player

The player is actually a tool that is intended for "higher things" than just sound. With it you can play a wide variety of video formats up to the QTVR. Of course, a subset of that is the tone. The player does not import the sound, but plays a separate sound file. This saves memory because the file only resides there during use. Of course, linked files must always be supplied with the project. The player is taken from the tool palette and is either in a map, a group or in a background [1, chap. 13.3.1 in the version from January 2011].

start player "Gong" is there gong the filename property of the player

While the player is being generated by the start command, a newPlayer message is sent that can be used with an on newPlayer script.

hide player (the selected text of button "Current Movie")
delete player

The properties and messages associated with a player can be found in the LiveCode Dictionary under Object> Player.

If you change the filename of a player, its time property is not changed. If necessary, you have to reset the currentTime to 0 so that the next sound starts all over again

Using the properties the duration and the timescale you can determine the duration of a player in seconds. Both properties are read-only:

put (the duration of me / the timeScale of me) into SpielzeitInSekunden

the duration of a player is an integer that indicates the number of intervals of the sound or movie in the player, the timescale indicates the number of intervals per second.

Other properties are

The command set the playrate of player to with -1

changes the game speed of the player with the number n to the speed m, where +1 is the normal speed and -1 means playing backwards.

With the playSelection property set to true, the play command only plays the range between the set startTime and endTime. At a given point in time the player is at currentTime.

With the callbacks property of a player, you can send callback messages at certain times of a player sequence in order to synchronize events with the playback (e.g. turning a sheet of music at the corresponding point in the music).

set the callbacks of player "Do It!" to "2500, soundNotes"

A player's callbacks can also be a whole list of callbacks, one per line. Each callback consists of an interval number and a message name separated by a comma.

set the callbacks of playesr "Mist" to myCallbacks

Instructions for displaying sound on the iPhone will come later.

Ongoing discussion

Programming takes place in the code editor. It is opened context-specifically when you right-click an object and choose Edit Script. When writing, it can happen that the indentations of the text are very confused. This can be easily fixed by pressing the TAB key.

9.1 Variables

9.1.1 Scope

As in the rest of programming, there are local and global variables. Global variable can be specified anywhere in a script. Personally, I think it makes sense to do this above the first handler in a script, because it is then valid for every handler of this and other scripts (also in substacks) without a further declaration. For example:

global gREVStackName
on preOpenStack
put empty into gREVStackName
end preOpenStack

The declaration could also be made within the script before the variable is used for the first time. Then the global variable has to be declared again as global in every handler in which it is to be used, otherwise it is regarded as a local variable and no longer knows the originally assigned value. In this case, too, the scope of the variables extends to all scripts in this stack and the substacks.

For local variable The following applies: You don't have to declare them separately within a handler. They arise when you occupy them - unless you have checked Edit> Variable Checking (with the script window selected). Then each local variable used must be in the form localxyz before using xyz be declared. The only advantage of this is that if there is a spelling mistake in the variable name, you are made aware of the error by aborting the compilation.

Something in the middle between global and local variables is that script local variable. It behaves like a global variable, but is only valid for the script of the one object. Even if you leave the card and come back, the value of the script local variable is retained. However, it is not declared in other scripts.

9.1.2 Type and declaration

Local variables do not have to be declared if Edit> Variable Checking is not checked. The type is also not specified in LC and an automatic conversion takes place if necessary. However, there are rare cases in which this can also fail and, for example, a blank is not converted into a zero (see example. The string 3 & space is only converted when an arithmetic operation takes place. To circumvent the problem in a specific case, you should use Word 2 of line 3)

String variable consist of a character or a character string and are enclosed in quotation marks, e.g. "Robert Wolff, 12/22/2010". From these chunks can be read like word 2 (results in "Wolff,") or char 3 (gives "b"). In the case of multi-line fields, mn can also be line read out.

9.2 Mouse related information

the mouseLoc #mouse coordinate
the clickLoc (clickH, clickV) # indicates where the last click was made

the clickLine or clickLine () # specifies the number of the line in a field that was last clicked on. The form is: line 3 of field 2. To do this, the text must be locked (Lock text checked in PI), because otherwise the user is expected to edit the text.

9.3 Cursor shapes

set the cursor to watch

10.1 Timing Events

send "mouseUp" to me in 10 seconds

10.2 External contact

It is possible to contact URLs and exchange data.


iOS has been integrated as a release base since version 4.5.2 of LC (in 4.5.1 it was still a plug-in). However, this option must be purchased in addition to LC. Warning: If you build a stack for iOS, it can no longer be used for other platforms. Since this only applies to the MainStack, you can make a front stack for iOS and put everything else in substacks, which can then be used on other platforms.

There are two ways to develop for iOS, namely for an iOS simulator or for a physical device. It is easier (and cheaper for the first project) to initially develop the app for the iPhone simulator (which of course also offers the environment for iPod touch and iPad). To do this, 4 points must be considered:
1) You have to have the LiveCode iOS license and set in Development> Simulator Version which version of the simulator the Apple SDK should use.
2) The correct settings must be made in LC: In File> Standalone Application Settings ... iOS must be selected in the top row; Check Build for iOS; and under supported devices (top right in the window) the target device is to be selected. Minimum iOS version indicates how far downward compatible the product should be.

Many other options are also specified in this window. Including the button Copy Files in the top line. Additional files belonging to the bundle can be added to the project. This can also be additional stacks. The name of the bundle can be set in General.
3) Need LC to find the SDK (s). To do this, set the path in LiveCode> Settings ...> Mobile Support.
Finally, you have to 4), if you want to send a stack to the iPhone simulator, click Simulate on the far right in the LC toolbar. If the Simlate button remains gray, LC has not seen any SDKs (mostly a path error - see previous point 3).

The other option is to develop for an existing iPhone / iPad. Points 1 and 2 are the same as above, but with 2) there is also the fact that you have to select a profile in the application settings window. You can get such a profile from Apple for a physical device if you are registered in the developer program (cost item 12/2010 USD99 / year). As registered iOS developer at Apple you can only use the simulator. Only when you do that iOS developer programs you can use File> Save as Standalone Application ... to test your own file on the device. A iPhone Developer Certificate to be installed. It is the digital signature for the developed app so that it can run on the test machine. The instructions can be found on Certficates Rider of the iPhone Developer Program Portal. At least 1 iOS device must be registered in this portal. (Add via the Devices Equestrian). On the App ID On the tab of the portal you also have to create an app ID for the app. You can use the same ID to develop and test different programs. Ultimately, the Provisioning Tab of the portal, the ID of the test device, the app ID and the certificate have been merged. The resulting provisioning file then appears in the Profile drop-down menu of the Application Settings. The next step is to set the bundle for the test device. To do this, open XCode and choose Window> Organizer. If you have connected your test device to the computer, it will appear in the left column. Then you can finally transfer the application bundle from your desk to the Applications Pull the list and let it run on the device. Make sure that the IDE version numbers match, otherwise a message "standalone origin mismatch" appears on the console of the XCode Organizer [6].

Finally, it's important

Icons for iPad must be 72x72px, for non-retina iPods and iPhones 57x57px and for retina devices 114x114px

For Apple's guidelines, see various Apple documents, such as [7]. A finished app can be used as an ad-hoc or an app store application, depending on the distribution profile used.

It is very important to note that the file system of Apple's iOS is case sensitive!

12.1 Setting up the file

12.1.1 Splash Screens

There is a difference between educational and commercial versions: The commercial version allows a static picture, which should stand for a long time until the project is loaded. As always for iOS, it has to be a .png with the dimensions of the respective screen. In the educational and personal version of LC, an LC screen is displayed for 5 seconds, indicating that this app is not licensed for commercial use. You can insert your own image within this screen, preferably with a resolution of 600 x 600 px.

12.1.2 Orientation

The app receives an orientationChanged message when the device detects a change in position relative to the ground. The orientation found in each case is conveyed in the iphoneDeviceOrientation () function. If you want to prevent the image from rotating, write an iphoneLockOrientation command in the on openStack code. Possible orientations are:

portrait upside down
landscape left
landscape right
face up
face down

To change the orientation of the UI use iphoneRotateInterfaceAlignment, in which Alignment the values portrait, portrait upside down, landscape left and landscape right can accept. If you wanted to adjust the interface orientation after a rotation, write:

on orientationChanged
iphoneRotateInterface iphoneDeviceOrientation ()
end orientationChanged

12.1.3 Dissolution

§IOS pre release handbook page 12

12.2 Buttons in iOS

here are the links to the current version of the buttons for the iPhone stack. Please watch out for line breaks

enjoy the revlet (you can actually select a button or an image with the select button and copy from the revlet to your stack)

Overview page


paste into your message box:

go stack url "http://www.berndniggemann.on-rev.com/btnsiphone/ButtonsiPhone_0.1.9.livecode"

Thanks Bernd

The iPad or iPhone doesn't have a mouse. All user interactions take place via touch events. Mouseup, Mauseloc etc. are also determined by touch. Touches begin with a touchStart, followed by one or more touchMove messages and end with a touchEnd or, if the touch was interrupted, for example on the iPhone from an incoming phone call, with a touchRelease. All of these messages have a unique ID, which makes it possible to perceive multi-touch events.

12.3 Movement

If there is a shake, the current card of the stack will receive a motionStart, at the end a motionEnd and if a call interrupts a motionRelease.

If you want to use the internal accelerometer, you can activate it with the iPhoneEnableAccelerometer [interval in seconds] and switch it off again with the iPhoneDisableAccelerometer. accelerationChanged supplies the values ​​x, y, z, t where x, y, z indicates the acceleration in the respective axis direction and t the time since the last measurement in seconds.

12.4 Photo picking

You can use the iPhone's photo picker with iPhonePickPhotosource, [max width, [maxheight]] call.

12.5 Sound in iOS

A testsound.mp3 or .aif can be played using the following method. Let us assume that the recording was in a folder "Sound samples" in the same folder as the LC project. Then this folder has to be added as a project resource. This is done in File> Standalone Application Settings ... in the Copy Files tab and then Add Folder (and if the files are loose: Add File).

To then establish the connection to the file, the absolute path should be used, because LC apparently does not set a "default folder" [5]

put the effective filename of this stack into tFilename
set itemdel to "/"
put "testsound.mp3" into item -1 of tFilename
play tFilename

Note that in iOS the command to stop a sound is play empty.

Various individual examples are collected here, special instructions for sound on the iPhone can be found in [3]. (Status 11/2010).

12.6 Bounciness

A typical quality on the iPhone and iPad is the elasticity with which objects or fields are moved. An example of this type of programming is the Finger program [9].

12.7 3rd party offers

12.7.1 MobGUI

"MobGUI is a plugin for LiveCode aimed at rapid mobile app development. With a growing set of custom controls to drag on to your projects, including native iOS controls (browser, movie player, scroller, text field), you can quickly turn ideas into prototypes and fully functioning apps. "

Test tools are located in the Development menu. In particular, you can see the program flow as the user will see it outside of the development environment when you call the Suspend Development Tools menu item.

With put string or put variable, the string or the variable is written to the standard error stream that can be seen in the message box. These outputs can also be seen in iOS, namely in Console.appwhen working in the simulator and in the Console-Rider of the XCode Organizersif a physical device is connected to the computer.

Writing it out in the message box is not trivial. To output more than one variable in a line, use the concatenation:

put clickLine () & CR & "Line number:" & char 6 of the clickline

It becomes more complex if you want to continue writing line by line in the message box. Then you write e.g.

put a
put CR & b after msg
put CR & c after msg

it is important that you do that after msg appends.

As we know from Apple products, the user experience, i.e. what the user or buyer experiences, is a very important part of his or her satisfaction or lack of it when buying or using a product.

14.1 User Preferences

Collecting User Preferences Part 1, Part 2

14.2 Password

password protection

14.3 Installation

There is a plug-in called Installer Maker

Publishing can now take place on different platforms, provided, of course, that it was developed for this platform.

15.1 Mac / Windows

In order to be able to publish on a computer platform, File> Standalone Application Settings ... must first be set up.

In LC ver. 4.5.2 it is so that after clicking on the corresponding platform at the top of the window there are still no setting options. Only when you change the platform and go back is it possible to make the corresponding changes.

15.2 iOS

Currently (12/2010) you get a 'Bundle Invalid' reaction when you try to send the app to the iTunes Store. The following quote from the LCForum / iOS board from Obleo:

think I may have found something that may help here. The iOs setting pane in the standalone builder under version already has 1.0.0 listed in the field next to version. But when one goes and builds it does not add the version number to the plist. If you go to that field and delete the 1.0.0 text from the field and re enter it, then save again, it should appear within the plist file. It sounds kind of dumb, but that how I had to get the cfbundleversion to show up on the plist file. Try it and see if that helps.

Publishing the procedure via the iTunes Store is quite time-consuming. There is software called PhoneDisk that enables data to be uploaded directly to the disk, including the iPad. While it is doubtful that it will work, it is definitely worth a try. Unfortunately, I cannot test this option myself at the moment.

FROMApplication browser
AIAdobe Illustrator
AppApplication, application, program
CICard Inspector (menu item and window of LC)
CRCarriage return, carriage return
IDEIntegrated Development Environment
PIProperty Inspector
QTQuickTime (Apple media platform)
QTVRQuickTime Virtual Reality (Apple media platform)
SIStack Inspector (menu item and window of LC)
TABTab (key)
UIUser interface

[1] LC userguide - to be found in the program itself under the menu item Help.
[2] Livecode journal images (as of November 21, 2010)
[3] lessons.runrev.com: How-do-I-play-sounds-on-the-iPhone. (As of 11/26/10)
[4] Developer tutorials (as of December 10, 2010)
[5] Thanks to Klaus Major
[6] Mark Waddingham: LiveCode for iOS Deployment Pack Rev.9 p.5f
[7] Apple: iOS Development Guide as of December 15, 2010
[8] runrev LiveCode Forums
[9] John Craig: Finger.livecode; download in Development> Rev Online> Finger
[10] http://www.mirye.net/livecode-faq/30-port-from-hypercard-to-revolution (as of 9.3.12)
[11] http://www.mirye.net/livecode-faq/73-convert-supercard-to-revolution (as of 9.3.12)