|

How do I... ?

AnswerList of Questions


Ask the User for Confirmation Before Exiting


In AutoPlay Media Studio, it is possible to stop closing your application based on user input, even after the close button has been pressed, or the Application.Exit action has been used. This is useful if, for example, you are worried that the user will accidentally close your application, or if you want to allow the user to save their changes before they exit.


To accomplish this, you must include a function (QueryAllowProjectClose) in your Global Functions (Project

image

> Global Functions) that returns true if the program should close, and false if it should not:


function QueryAllowProjectClose() --this function will be called when the program is exiting

confirmation = Dialog.Message("Are you sure?", "Are you sure that you want to exit?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);

if confirmation == 6 then

-- The yes button was pressed, allow program to close (return

true)


else


return true;


-- The yes button was NOT pressed, do NOT allow the program to

close (Return false)

return false;


end

end


image

Note: This function is called internally by your application when it is told to exit. If true is returned, your application will exit. If false is returned, your program will not exit.


To use this function, you would use script similar to this:


if QueryAllowProjectClose() then Application.Exit();

end


image

image

How do I... ?

AnswerList of Questions


Auto-Save My Project


Computer crashes are inevitable, and it seems that computers crash at the worst possible moments. AutoPlay Media Studio has a built in option to save your project at an interval that you choose.


To enable this option:


1. Choose Edit > Preferences from the menu.


2. Click on Document.


3. Enable the Auto Save feature and choose your desired interval between saves.


4. Click OK.


image

|