SlideShare a Scribd company logo
1 of 13
Download to read offline
Calculator
Day 3 :
Messages
Create It With
in cooperation with
1
Understanding the
MESSAGES
2
Calculator App
What is a Message?
A message is indeed like a chat. When some
kind of event happens - like the user clicks a
button, LiveCode will send a message to
your the program.
The question is what do you want to do
when you get the message. Your reply is the
code you write in LiveCode. This is how you
“chat” with LiveCode.
Click Me
3
Calculator App
More on Messages
There are lots of more resources available
on the message path. They do a good job
explaining the concept.
As you can see in the video. The Dictionary
located in the LiveCode IDE will give you
full access on all events.
Some are much more advanced, like
Richard Gaskin’s Extending the LiveCode
Message path.
The LiveCode Message Path
Messages in LiveCode
Advanced [only for reference]:
Extending the LiveCode Message Path
LESSONS
4
Calculator App
This message hierarchy allows us to place
the code needed by several interface
controls into a higher level, available to all
of those controls.
One such case will be with the calculator's
number buttons; each one needs to do
exactly the same thing, and by putting that
code into the card level, each of them can
make use of that single handler.
Running the sample App and watching the video will
help you understand.
5
Calculator App
Message Path
The pass command tells LiveCode that after the
control has processed the message, it will be “passed”
up to the next level of the hierarchy along the
message path for a mouseUp handler, which could be
that in a group or card script, for example.
If an appropriate handler is found, it will then execute
that handler in the group or card script and stop
moving up the levels unless there is also a pass
command in that handler.
Note: When the pass command is executed, any remaining
statements in the handler are skipped, so this command is
almost always placed at the end of a handler or within an if-
control structure.
Pass
on mouseDown
beep
-- keep passing the message on
pass mouseDown
end mouseDown
6
Calculator App
mouseDown: Handle the mouseDown message to perform an action when the user presses the mouse
button, before the mouse button is released.
mouseEnter: Handle the mouseEnter message to perform an action (for example, display additional
information or highlight a button) when the mouse pointer enters an object.
mouseLeave: Handle the mouseLeave message to update a control when the mouse pointer moves
outside it.
mouseMove: Handle the mouseMove message if you want to perform some action (such as updating a
field) when the user moves the mouse, or if you want to keep continuous track of the mouse pointer's
position.
mouseUp: Handle the mouseUp message to perform an action when the user releases the mouse button
after clicking.
Mouse Messages
7
Calculator App
deleteField: Handle the deleteField message if you want to perform cleanup before a field is removed from
the stack.
enterInField: Handle the enterInField message when you want to perform an action when the user presses
Enter in a field.
exitField: Handle the exitField message if you want to do something when the user leaves a field that hasn't
been changed.
openField: Handle the openField message if you want to do something when the user enters a field.
returnInField: Handle the returnInField message when you want to perform an action (such as adding a
column of figures) when the user presses Return in a field.
Field Messages
8
Calculator App
deleteField: Handle the deleteField message if you want to perform cleanup before a field is removed from
the stack.
enterInField: Handle the enterInField message when you want to perform an action when the user presses
Enter in a field.
exitField: Handle the exitField message if you want to do something when the user leaves a field that hasn't
been changed.
openField: Handle the openField message if you want to do something when the user enters a field.
returnInField: Handle the returnInField message when you want to perform an action (such as adding a
column of figures) when the user presses Return in a field.
Field Messages
9
Calculator App
openBackground: Handle the openBackground message to change a group's objects, or perform other
updates, when a card with the group on it is opened.
preOpenCard: Handle the preOpenCard message to update a card's appearance before the card appears
on screen.
openCard: Handle the openCard message to change a card's objects, or perform other updates, when the
card is visited.
preOpenStack: Handle the preOpenStack message to update a card's appearance before the card
appears on screen.
openStack: Handle the openStack message to change a stack's objects, or perform other updates, when
the stack is opened.
Open/Close Messages
10
Calculator App
keyDown: Handle the keyDown message if you want to do something special when the user presses any
key or a particular key you check for in the handler.
keyUp: Handle the keyUp message if you want to do something special when the user releases any key (or
a particular key you check for in the handler).
deleteKey: Handle the deleteKey message if you want to do something special when the user presses the
forward delete key.
escapeKey: Handle the escapeKey message if you want to perform some action when the user presses
Escape.
tabKey: Handle the tabKey message when you want to perform an action (such as going to the next card)
when the user presses the Tab key.
Keyboard Messages
11
Calculator App
pushNotificationReceived: Sent when the application receives a push notification from a Push Notification
Server.
purchaseStateUpdate: Sent by the store to notify the app of any changes in state to the purchase request.
movieTouched: Handle the movieTouched message to perform an action when a full screen movie is
playing and the user touches the screen.
adLoaded: Sent when an ad had loaded (or reloaded).
adClicked: Handle the adClicked message if you want to perform an action when a user clicks on an ad.
touchStart: Sent when a user touches a control in a mobile application
Mobile Messages
12
Calculator App
If you wish to learn more… Visit LiveCode
Congrats on learning:
Messages
Calculator App
13

More Related Content

What's hot

IOS Swift language 1st Tutorial
IOS Swift language 1st TutorialIOS Swift language 1st Tutorial
IOS Swift language 1st TutorialHassan A-j
 
Theatre Booking System Lesson 3
Theatre Booking System   Lesson 3Theatre Booking System   Lesson 3
Theatre Booking System Lesson 3mrbelshaw
 
910m30manenglish
910m30manenglish910m30manenglish
910m30manenglishyunusd1
 
Keyboard shortcut - Phím tắt hệ điều hành windows 10
Keyboard shortcut - Phím tắt hệ điều hành windows 10Keyboard shortcut - Phím tắt hệ điều hành windows 10
Keyboard shortcut - Phím tắt hệ điều hành windows 10Sơn Đặng Thái
 
If then statement activity
If then statement activityIf then statement activity
If then statement activitymajoydrew
 
Learning R while exploring statistics
Learning R while exploring statisticsLearning R while exploring statistics
Learning R while exploring statisticsDorothy Bishop
 
Libop Calculator for Android Features
Libop Calculator for Android FeaturesLibop Calculator for Android Features
Libop Calculator for Android FeaturesWoodgates E.I.R.L.
 
Excel Presentation
Excel PresentationExcel Presentation
Excel PresentationBizzyb09
 
Excel Presentation
Excel PresentationExcel Presentation
Excel PresentationBizzyb09
 
Windows 8 tips & tricks
Windows 8 tips & tricksWindows 8 tips & tricks
Windows 8 tips & tricksMukund Trivedi
 
Basic computer-programming-2
Basic computer-programming-2Basic computer-programming-2
Basic computer-programming-2lemonmichelangelo
 
Android notifications. testing guideline
Android notifications. testing guidelineAndroid notifications. testing guideline
Android notifications. testing guidelineTechMagic
 
Magazine awr-ims-3
Magazine awr-ims-3Magazine awr-ims-3
Magazine awr-ims-3Sam Sambala
 
Loop structures chpt_6
Loop structures chpt_6Loop structures chpt_6
Loop structures chpt_6cmontanez
 

What's hot (20)

IOS Swift language 1st Tutorial
IOS Swift language 1st TutorialIOS Swift language 1st Tutorial
IOS Swift language 1st Tutorial
 
Modul 1 Scratch
Modul 1 ScratchModul 1 Scratch
Modul 1 Scratch
 
Java calculator
Java calculatorJava calculator
Java calculator
 
Theatre Booking System Lesson 3
Theatre Booking System   Lesson 3Theatre Booking System   Lesson 3
Theatre Booking System Lesson 3
 
910m30manenglish
910m30manenglish910m30manenglish
910m30manenglish
 
Spf chapter10 events
Spf chapter10 eventsSpf chapter10 events
Spf chapter10 events
 
Keyboard shortcut - Phím tắt hệ điều hành windows 10
Keyboard shortcut - Phím tắt hệ điều hành windows 10Keyboard shortcut - Phím tắt hệ điều hành windows 10
Keyboard shortcut - Phím tắt hệ điều hành windows 10
 
If then statement activity
If then statement activityIf then statement activity
If then statement activity
 
Learning R while exploring statistics
Learning R while exploring statisticsLearning R while exploring statistics
Learning R while exploring statistics
 
Libop Calculator for Android Features
Libop Calculator for Android FeaturesLibop Calculator for Android Features
Libop Calculator for Android Features
 
Excel Presentation
Excel PresentationExcel Presentation
Excel Presentation
 
Excel Presentation
Excel PresentationExcel Presentation
Excel Presentation
 
Windows 8 tips & tricks
Windows 8 tips & tricksWindows 8 tips & tricks
Windows 8 tips & tricks
 
programming for Calculator in java
programming for Calculator in javaprogramming for Calculator in java
programming for Calculator in java
 
Basic computer-programming-2
Basic computer-programming-2Basic computer-programming-2
Basic computer-programming-2
 
Rational rose
Rational roseRational rose
Rational rose
 
Print9
Print9Print9
Print9
 
Android notifications. testing guideline
Android notifications. testing guidelineAndroid notifications. testing guideline
Android notifications. testing guideline
 
Magazine awr-ims-3
Magazine awr-ims-3Magazine awr-ims-3
Magazine awr-ims-3
 
Loop structures chpt_6
Loop structures chpt_6Loop structures chpt_6
Loop structures chpt_6
 

Viewers also liked

LiveCode resources
LiveCode resourcesLiveCode resources
LiveCode resourceslivecode
 
Sample project abstract
Sample project abstractSample project abstract
Sample project abstractklezeh
 
My Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & SnapshotsMy Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & SnapshotsUsman Sait
 
Creación de apps móviles sin conocimientos de programación
Creación de apps móviles sin conocimientos de programaciónCreación de apps móviles sin conocimientos de programación
Creación de apps móviles sin conocimientos de programaciónEnrique Farez
 
Live code manual Español
Live code manual EspañolLive code manual Español
Live code manual EspañolSykrayo
 

Viewers also liked (9)

Simplest calculator app using android studio android workshop
Simplest calculator app using android studio   android workshopSimplest calculator app using android studio   android workshop
Simplest calculator app using android studio android workshop
 
Calc app
Calc appCalc app
Calc app
 
0 agardêniabranca...(lila)
0 agardêniabranca...(lila)0 agardêniabranca...(lila)
0 agardêniabranca...(lila)
 
LiveCode resources
LiveCode resourcesLiveCode resources
LiveCode resources
 
Sample project abstract
Sample project abstractSample project abstract
Sample project abstract
 
Android ppt
Android pptAndroid ppt
Android ppt
 
My Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & SnapshotsMy Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & Snapshots
 
Creación de apps móviles sin conocimientos de programación
Creación de apps móviles sin conocimientos de programaciónCreación de apps móviles sin conocimientos de programación
Creación de apps móviles sin conocimientos de programación
 
Live code manual Español
Live code manual EspañolLive code manual Español
Live code manual Español
 

Similar to Understand LiveCode messages

Similar to Understand LiveCode messages (20)

Practicalfileofvb workshop
Practicalfileofvb workshopPracticalfileofvb workshop
Practicalfileofvb workshop
 
06 win forms
06 win forms06 win forms
06 win forms
 
Notification android
Notification androidNotification android
Notification android
 
SPF WinForm Programs
SPF WinForm ProgramsSPF WinForm Programs
SPF WinForm Programs
 
Scmad Chapter05
Scmad Chapter05Scmad Chapter05
Scmad Chapter05
 
Gui builder
Gui builderGui builder
Gui builder
 
Tutorials3
Tutorials3Tutorials3
Tutorials3
 
Spf chapter 03 WinForm
Spf chapter 03 WinFormSpf chapter 03 WinForm
Spf chapter 03 WinForm
 
Vb%20 tutorial
Vb%20 tutorialVb%20 tutorial
Vb%20 tutorial
 
Android action bar and notifications-chapter16
Android action bar and notifications-chapter16Android action bar and notifications-chapter16
Android action bar and notifications-chapter16
 
3 - Thermometer.pptx thermometer thermometer thermometer
3 - Thermometer.pptx thermometer thermometer thermometer3 - Thermometer.pptx thermometer thermometer thermometer
3 - Thermometer.pptx thermometer thermometer thermometer
 
Auto CAD - 2D
Auto CAD - 2DAuto CAD - 2D
Auto CAD - 2D
 
Autocad Training Delhi
Autocad Training DelhiAutocad Training Delhi
Autocad Training Delhi
 
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
10.USING THE ECLIPSE DEBUGGERupdated 8618This t.docx
 
Android notifications
Android notificationsAndroid notifications
Android notifications
 
macbook for beginners
macbook for beginnersmacbook for beginners
macbook for beginners
 
MobileAppDev Handout#6
MobileAppDev Handout#6MobileAppDev Handout#6
MobileAppDev Handout#6
 
Vb.net and .Net Framework
Vb.net and .Net FrameworkVb.net and .Net Framework
Vb.net and .Net Framework
 
Visual basic
Visual basicVisual basic
Visual basic
 
Introducing Scratch
Introducing ScratchIntroducing Scratch
Introducing Scratch
 

Understand LiveCode messages

  • 1. Calculator Day 3 : Messages Create It With in cooperation with 1
  • 3. What is a Message? A message is indeed like a chat. When some kind of event happens - like the user clicks a button, LiveCode will send a message to your the program. The question is what do you want to do when you get the message. Your reply is the code you write in LiveCode. This is how you “chat” with LiveCode. Click Me 3 Calculator App
  • 4. More on Messages There are lots of more resources available on the message path. They do a good job explaining the concept. As you can see in the video. The Dictionary located in the LiveCode IDE will give you full access on all events. Some are much more advanced, like Richard Gaskin’s Extending the LiveCode Message path. The LiveCode Message Path Messages in LiveCode Advanced [only for reference]: Extending the LiveCode Message Path LESSONS 4 Calculator App
  • 5. This message hierarchy allows us to place the code needed by several interface controls into a higher level, available to all of those controls. One such case will be with the calculator's number buttons; each one needs to do exactly the same thing, and by putting that code into the card level, each of them can make use of that single handler. Running the sample App and watching the video will help you understand. 5 Calculator App Message Path
  • 6. The pass command tells LiveCode that after the control has processed the message, it will be “passed” up to the next level of the hierarchy along the message path for a mouseUp handler, which could be that in a group or card script, for example. If an appropriate handler is found, it will then execute that handler in the group or card script and stop moving up the levels unless there is also a pass command in that handler. Note: When the pass command is executed, any remaining statements in the handler are skipped, so this command is almost always placed at the end of a handler or within an if- control structure. Pass on mouseDown beep -- keep passing the message on pass mouseDown end mouseDown 6 Calculator App
  • 7. mouseDown: Handle the mouseDown message to perform an action when the user presses the mouse button, before the mouse button is released. mouseEnter: Handle the mouseEnter message to perform an action (for example, display additional information or highlight a button) when the mouse pointer enters an object. mouseLeave: Handle the mouseLeave message to update a control when the mouse pointer moves outside it. mouseMove: Handle the mouseMove message if you want to perform some action (such as updating a field) when the user moves the mouse, or if you want to keep continuous track of the mouse pointer's position. mouseUp: Handle the mouseUp message to perform an action when the user releases the mouse button after clicking. Mouse Messages 7 Calculator App
  • 8. deleteField: Handle the deleteField message if you want to perform cleanup before a field is removed from the stack. enterInField: Handle the enterInField message when you want to perform an action when the user presses Enter in a field. exitField: Handle the exitField message if you want to do something when the user leaves a field that hasn't been changed. openField: Handle the openField message if you want to do something when the user enters a field. returnInField: Handle the returnInField message when you want to perform an action (such as adding a column of figures) when the user presses Return in a field. Field Messages 8 Calculator App
  • 9. deleteField: Handle the deleteField message if you want to perform cleanup before a field is removed from the stack. enterInField: Handle the enterInField message when you want to perform an action when the user presses Enter in a field. exitField: Handle the exitField message if you want to do something when the user leaves a field that hasn't been changed. openField: Handle the openField message if you want to do something when the user enters a field. returnInField: Handle the returnInField message when you want to perform an action (such as adding a column of figures) when the user presses Return in a field. Field Messages 9 Calculator App
  • 10. openBackground: Handle the openBackground message to change a group's objects, or perform other updates, when a card with the group on it is opened. preOpenCard: Handle the preOpenCard message to update a card's appearance before the card appears on screen. openCard: Handle the openCard message to change a card's objects, or perform other updates, when the card is visited. preOpenStack: Handle the preOpenStack message to update a card's appearance before the card appears on screen. openStack: Handle the openStack message to change a stack's objects, or perform other updates, when the stack is opened. Open/Close Messages 10 Calculator App
  • 11. keyDown: Handle the keyDown message if you want to do something special when the user presses any key or a particular key you check for in the handler. keyUp: Handle the keyUp message if you want to do something special when the user releases any key (or a particular key you check for in the handler). deleteKey: Handle the deleteKey message if you want to do something special when the user presses the forward delete key. escapeKey: Handle the escapeKey message if you want to perform some action when the user presses Escape. tabKey: Handle the tabKey message when you want to perform an action (such as going to the next card) when the user presses the Tab key. Keyboard Messages 11 Calculator App
  • 12. pushNotificationReceived: Sent when the application receives a push notification from a Push Notification Server. purchaseStateUpdate: Sent by the store to notify the app of any changes in state to the purchase request. movieTouched: Handle the movieTouched message to perform an action when a full screen movie is playing and the user touches the screen. adLoaded: Sent when an ad had loaded (or reloaded). adClicked: Handle the adClicked message if you want to perform an action when a user clicks on an ad. touchStart: Sent when a user touches a control in a mobile application Mobile Messages 12 Calculator App
  • 13. If you wish to learn more… Visit LiveCode Congrats on learning: Messages Calculator App 13