Indigo Rose Software

Go Back   Indigo Rose Software Forums > Old Versions > AutoPlay Media Studio 4.0 > AutoPlay Media Studio 4.0 Examples

 
 
Thread Tools Display Modes
  #1  
Old 10-03-2002
Support Support is offline
Super Moderator
 
Join Date: Jan 2000
Location: Indigo Rose Corporation
Posts: 204
INFO: The Difference between the "On Close" and "On Destroy" Events

INFO: The Difference between the "On Close" and "On Destroy" Events

INFO: The Difference between the "On Close" and "On Destroy" Events

Document ID: IR04014
The information in this article applies to:
  • AutoPlay Media Studio 4.0

SUMMARY

This article will explain the difference between the "On Close" and "On Destroy" events.

DISCUSSION

In AutoPlay Media Studio 4.0 both the Project, and each Page, have "On Close" and "On Destroy" events. These events are similar but in order to use them properly you must be aware of their differences.

Page

The "On Close" event is triggered when something happens to "initiate" a page close, e.g., a Page.Jump action has been performed.

At this point, you can override the closing of the page by setting the variable %PreventPageClose% to TRUE.

The "On Destroy" event is only triggered after all of the "On Close" actions. At this point, the page is going to close, and there's nothing you can do to stop it from closing. The page is essentially deleted from memory (hence the name).

Project

The "On Close" event is triggered when the user attempts to exit your AutoPlay application, usually by clicking on the application window's Close button or as the result of an Application.Exit action.

You could think of this event as the user "requesting" that the application be closed.

This event allows you to "override" the user's request to exit (for example, until they have provided all the information you require for product registration) by setting the built-in variable %PreventApplicationClose% to TRUE (causing the user's close attempt to be ignored).

The "On Destroy" event is triggered after the On Close actions have been performed and it has been determined that the AutoPlay application really will close. (In other words, %PreventApplicationClose% is currently set to false.) At this point, there is nothing you can do to prevent the application from closing—it will close, no matter what.

This is where you should put any "on close" actions that you want performed when the application is about to shut down. For example, you may wish to delete any temporary files that were used by your application, or undo any other temporary changes that were made to the user's system. Or you might want to use a Dialog.Timed Message action to remind the users of something important as they go.

So the main difference between the two events is that the "On Close" event is triggered at the first moment when it is known that the page/application is going to close. This occurs before the page/application has actually begun to close. Then the "On Destroy" event is triggered, this event occurs after the page/application has closed.

MORE INFORMATION

For more information please see the following topics in the AutoPlay Media Studio 4.0 Help:

  • Command Reference | Pages | Page Properties Dialog
  • Command Reference | Project Settings
  • KEYWORDS: AutoPlay Media Studio 4.0, Events, On Close, On Destroy


    Last reviewed: October 3, 2002
    Copyright © 2002 Indigo Rose Corporation. All rights reserved.
     

    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is On



    All times are GMT -6. The time now is 03:18 AM.


    Powered by vBulletin® Version 3.8.4
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
    Indigo Rose Software