So far, we only needed to look at the buttons and fields to be able to create the calculator. In the later chapters, we will use many more controls, so let's take a sneak peek at those.
LiveCode can play movies using the Player control type. These can be added to the card in several ways and then using a script command:
new player "player name"
Having added the player to the card, you can then set the video file to be played by entering the file path or URL of the file under the Basic Settings option of the Inspector palette. You can also set the path to the video with script:
set the filename of player "player name" to "file path or URL"
In much the same way as you just saw for the playing of video, still images can be added to a stack. All of the options shown to add a video player can be done in the same way for images. Here, for example, is the script needed to add the RunRev company logo to the card:
new image "revlogo" set the filename of image "revlogo" to "http://runrev.com/wp-content/themes/runrev2013/ims/runrev_logo.png"
Images that you import can be used as icons in a button. To set up a button, so that it has a nice idle state image and an associated highlight image, you would have to go through the following steps:
In the following screenshot, we can see two images that have been imported in order to give the Begin button a more iOS-like appearance. The button is selected and the Inspector palette shows the icon selection choices:
When you choose an image for use, the button itself is updated. In this case, the Hilite icon has been set to the darker version of the graphic, but as shown here, the button still needs to be resized.