Livecode Wiki
Advertisement

A Message sent to the current card when the user goes to another card. If there is a message handler by the same name in the message path, then it will be executed.

Message[]

Syntax:

closeCard

The closeCard message is sent when the user either goes to another card in the same stack, or closes the stack.

The actual navigation is not triggered by the closeCard message, so trapping the message and not allowing it to pass does not prevent the card from closing.

Message handler[]

Example:

on closeCard                        -- record date and time the card was last viewed
  set the lastAccessDate of the target to the seconds
  pass closeCard
end closeCard

Use a closeCard handler to perform cleanup or do other tasks when the user leaves a card.

See also: closeStack, shutdown, closeBackground, & preOpenCard.

Advertisement