Remembering Runtime Preferences
Document ID: IR10022The information in this article applies to:
- AutoPlay Media Studio 5.0 Professional Edition
SUMMARY
This article describes how to remember the user's runtime preference.
DISCUSSION
As an example, let us assume that your application asks the user if videos should be visible in the application. But you only want to ask the user the first time they launch the program. On each subsequent launch, you wish to show/hide the video object based on the user's initial preference.
To accomplish this in AutoPlay Media Studio 5.0:
Insert the following code into the On Preload event of the page containing the video object:visible = Application.LoadValue("Application", "Video");
if visible == "" then
visible = Dialog.Message("Visible videos", "Do you want the Video Objects to be visible?", MB_YESNO);
Application.SaveValue("Application", "Video", visible);
end
if visible == 7 then
Video.SetVisible("Video1", false);
end
This script does not give the user a second choice. Once they choose yes/no, that choice is permanent. If you wanted to offer the user a second choice, or the option to change the setting later, include the following code in the On Click event of a button object:visible = Dialog.Message("Visible videos", "Do you want the Video Objects to be visible?", MB_YESNO);
Application.SaveValue("Application", "Video", visible);
MORE INFORMATION
For more information please see the following topics in the AutoPlay Media Studio 5.0 help file:
- Program Reference | Actions | Application | Application.LoadValue
- Program Reference | Actions | Application | Application.SaveValue
KEYWORDS: AutoPlay Media Studio 5.0, Actions, Preferences, Value, Load, Save, Runtime
Last reviewed: September 26, 2003
Copyright © 2003 Indigo Rose Corporation. All rights reserved.