OverviewInterfaceSpecial FeaturesEvents
Each event represents something that can happen at run time. When an event is triggered, any script that was added to it will be performed.
Note: Some events contain special event variables that are local to the event and contain more information about the event.
Here are all of the possible events in AutoPlay Media Studio:
The actions that will be performed whenever an audio channel's state changes on the page or dialog. For example, if a channel's audio is paused, this event will be triggered.
The following event variables are automatically set whenever this event is triggered:
(number) The audio channel whose state has changed. One of the following channel values will be returned:
CONSTANT |
VALUE |
DESCRIPTION |
CHANNEL_BACKGROUND |
5 |
Background audio channel. |
CHANNEL_EFFECTS |
0 |
Effects channel (used for mouse over, down, and click sounds). |
CHANNEL_NARRATION |
6 |
Narration channel (used for voice overs). |
CHANNEL_USER1 |
1 |
User channel 1. |
CHANNEL_USER2 |
2 |
User channel 2. |
CHANNEL_USER3 |
3 |
User channel 3. |
CHANNEL_USER4 |
4 |
User channel 4. |
CHANNEL_ALL |
-3 |
All audio channels. |
(string) The state that the audio channel has changed to. One of the following states will be returned:
VALUE |
TYPE |
DESCRIPTION |
Finish |
string |
The audio channel's track reached it's end. |
Pause |
string |
The audio channel was paused using the Audio.Pause action. |
Play |
string |
The audio channel was played using the Audio.Play action |
Stop |
string |
The audio channel was stopped using the Audio.Stop action. |
The actions that will be performed whenever the text of a cell changes for any reason in a grid object. This may result from the user editing cell text or from text being pasted in or even from the text changing in response to an action such as Grid.SetCellText.
(number) The row (0-based) of the cell that changed.
(number) The column (0-based) of the cell that changed.
(number) The text that was in the cell before it was changed.
(number) The new text of the cell.
The actions that will be performed whenever the cursor is inside an input object and receives the WM_CHAR windows message. This event will occur after the input object's On Key event is fired, but will not necessarily be fired after each key stroke. This event is similar to the On Key event, except instead of being fired each time a key is pressed, On Char is fired when a keystroke (or a combination of keystrokes) translates to a character.
The following event variables are automatically set whenever this event is triggered:
(number) The character code of the key that was pressed.
(table) A table containing three boolean values that describe which modifier keys were held down while the key was pressed. A modifier key is a key that can be held down while another key is pressed, to "modify" it.
There are three true/false values in the table, one for each type of modifier key on the keyboard: shift, ctrl, and alt. You can access these values as e_Modifiers.shift, e_Modifiers.ctrl, and e_Modifiers.alt.
The actions that will be performed whenever an item is checked/unchecked in a tree or listbox object.
ListBox - Note that clicking on an unselected checkbox in the list will trigger an On Select event before the On Check event is fired. This is the normal behaviour for checklist box controls in Windows. Specifically, clicking on a checkbox in the list toggles the check for all selected items. If the item is currently unselected, it is selected first, then the checkbox is toggled.
ListBox - Note: If the item is already selected, there will be no On Select event first. Do not depend on there being an On Select every time you toggle a check box.
The following event variables are automatically set whenever this event is triggered: (only available for the tree object).
(string) The index of the node being checked/unchecked.
(boolean) True if the node has been checked, false if it has been unchecked.
The actions that will be performed when the user clicks on this object.
The actions that will be performed whenever the page or dialog is closed.
Tip: If you need to prevent the user from closing the dialog or want to add a confirmation message, you can use the built-in function QueryAllowDialogClose.
The actions that will be performed when the user double-clicks within the bounds of this object.
The actions that will be performed whenever an item's label is changed in the tree object.
The following event variables are automatically set whenever this event is triggered:
(string) The index of the node being edited.
(string) The text that has just been set.
(string) The text that existed previously before the user edited the current node.
The actions that will be performed when the mouse moves onto this object ("enters" the object's territory).
The actions that will be performed when an error occurs in a QuickTime object.
The following event variables are automatically set whenever this event is triggered:
(number) The numeric code of the error that has occurred.
(number) Where the error originated from:
CONSTANT |
VALUE |
DESCRIPTION |
qtErrorEventOriginControl |
0 |
An error occurred in the QTControl area of the QuickTime ActiveX control. |
qtErrorEventOriginMovie |
1 |
An error occurred in the QTMovie area of the QuickTime ActiveX control. |
qtErrorEventOriginQuickTime |
2 |
An error occurred in the QTQuickTime area of the QuickTime ActiveX control. |
The actions that will be performed whenever an item is expanded/collapsed in the tree object.
(string) The index of the node being expanded/collapsed.
(boolean) True if the node has been expanded, false if it has been collapsed.
The actions that will be performed whenever the video reaches the end in a video object.
The actions that will be performed whenever the slideshow reaches the end in a slideshow object.
Note: If the Loop setting is selected, this event will not be fired.
The actions that will be performed whenever an exposed Flash actionscript function is called using the control's external API (ExternalInterface class) causing it to dispatch its FlashCall event. You can respond to Flash actionscript function calls using the Flash.SetReturnValue action, or call Flash actionscript functions using the Flash.CallFunction action.
Flash's external API offers additional functionality compared to fscommand() by allowing any number of arguments to be passed as well as various data types.
Note: This event is only available in Flash version 8.0 or later.
(string) An XML formatted string containing the function request from the Flash file's actionscript code. This string can be parsed using the available XML actions.
Note: This event is available for input objects, listbox objects, combobox objects, richtext objects, and tree objects in your project.
The actions that will be performed whenever the object is given focus. For example, it will be given focus if the user clicks inside the object.
The actions that will be performed whenever an fscommand() function is performed in the Flash file's internal actionscript code.
Note: "fscommand()" is the name of a Flash actionscript function that allows a .swf file to send a message or "command" to the application that is playing it. Whenever a Flash file calls the fscommand() function, AutoPlay responds by performing the action that you assigned to the On FSCommand event.
Tip: The Flash fscommand() function passes a command in the form of a short text string. You can use AutoPlay's own scripting abilities to differentiate between fscommand() calls that pass different command strings. In fact, your Flash file can use the fscommand() function to send any number of custom commands to your AutoPlay application, and you can make your application respond to each command in any way you want.
The following event variables are automatically set whenever this event is triggered:
(string) A string containing the last FSCommand fired within the Flash object.
(string) A string containing the arguments of the last FSCommand fired within the Flash object.
The actions that will be performed when the user clicks on a hyperlink in a markup enabled xButton object.
The following event variable is automatically set whenever this event is triggered:
(string) A string containing the hyperlink text that the user clicked on an xButton object. This is the text surrounded by Hyperlink tags in its markup text. For example, "Link Text" would be returned if the markup text contained <Hyperlink>Link Text</Hyperlink>.
Note: This event is available for the input object, listbox object, combobox object, tree object, richtext object and each page or dialog in your project.
On the input object, these are the actions that will be performed whenever the cursor is inside the input object and the user presses a key.
On the listbox object, these are the actions that will be performed whenever the listbox object has focus and the user presses a key.
On the combobox object, these are the actions that will be performed whenever the combobox object has focus and the user presses a key.
On the tree object, these are the actions that will be performed whenever the combobox object has focus and the user presses a key.
On the richtext object, these are the actions that will be performed whenever the richtext object has focus and the user presses a key.
On a page, these are the actions that will be performed whenever the application window has focus and the user presses a key.
On a dialog, these are the actions that will be performed whenever the dialog window has focus and the user presses a key.
The following event variables are automatically set whenever this event is triggered:
(number) The virtual key code of the key that was pressed.
(table) A table containing three boolean values that describe which modifier keys were held down while the key was pressed. A modifier key is a key that can be held down while another key is pressed, to "modify" it.
There are three true/false values in the table, one for each type of modifier key on the keyboard: shift, ctrl, and alt. You can access these values as e_Modifiers.shift, e_Modifiers.ctrl, and e_Modifiers.alt.
The actions that will be performed when the mouse moves off of this object ("leaves" the object's territory).
Note: This event is available for richtext objects in your project.
The actions that will be performed when the user clicks on a link in a richtext object.
Note: To use this event, you must have the Auto-detect URL feature enabled.
The following event variables are automatically set whenever this event is triggered:
(number) The 1-based character index where the link's text begins.
(number) The 1-based character index where the link's text ends.
(string) The text of the link that was clicked.
The actions that will be performed whenever the URL being navigated to has finished loading.
The following event variables are automatically set whenever this event is triggered:
(string) A string containing the URL that has finished loading.
The actions that will be performed when the user interacts with the menu bar.
The following event variables are automatically set whenever this event is triggered:
(number) The item ID of the menu item currently being interacted with.
(table) Extended information about the currently selected menu item.
KEY |
TYPE |
DESCRIPTION |
Text |
string |
The text of the menu item currently being interacted with. |
ID |
number |
The item ID of the menu item currently being interacted with. |
IconID |
number |
The 0-based icon index from the Image List specified on the Menu Bar for the menu item. |
Enabled |
boolean |
True if the current menu item is enabled, false if it is not. |
Checked |
boolean |
True if the current menu item is checked, false if it is not. |
The actions that will be performed when a mouse button is clicked within the bounds of your application.
The following event variables are automatically set whenever this event is triggered:
(number) A number containing the type of mouse-button click that occurred:
CONSTANT |
VALUE |
DESCRIPTION |
LEFT_BUTTON_DOWN |
0 |
Left mouse button has been pressed. |
LEFT_BUTTON_UP |
1 |
Left mouse button has been released. |
RIGHT_BUTTON_DOWN |
2 |
Right mouse button has been pressed. |
RIGHT_BUTTON_UP |
3 |
Right mouse button has been released. |
(number) The horizontal position of the mouse cursor, in pixels, from the left side of the page or dialog.
(number) The vertical position of the mouse cursor, in pixels, from the right side of the page or dialog.
The actions that will be performed when the cursor is over a QuickTime object and a mouse button is pressed down.
The following event variables are automatically set whenever this event is triggered:
(number) The index of the button that was pressed:
CONSTANT |
VALUE |
DESCRIPTION |
BUTTON_LEFT |
1 |
Left mouse button. |
BUTTON_RIGHT |
2 |
Right mouse button. |
BUTTON_MIDDLE |
3 |
Middle mouse button. |
(table) A table containing three boolean values that describe which modifier keys were held down while the mouse button was pressed. A modifier key is a key that can be held down while button is pressed, to "modify" it.
There are three true/false values in the table, one for each type of modifier key on the keyboard: shift, ctrl, and alt. You can access these values as e_Modifiers.shift, e_Modifiers.ctrl, and e_Modifiers.alt.
(number) The horizontal position of the mouse cursor when the mouse button was pressed, relative to the top left of the object.
(number) The vertical position of the mouse cursor when the mouse button was pressed, relative to the top left of the object.
(number) The horizontal position of the mouse cursor when the mouse button was pressed, relative to the top left of the page.
(number) The vertical position of the mouse cursor when the mouse button was pressed, relative to the top left of the page.
The actions that will be performed when the cursor is over a QuickTime object and a mouse button is released.
The following event variables are automatically set whenever this event is triggered:
(number) The index of the button that was pressed:
CONSTANT |
VALUE |
DESCRIPTION |
BUTTON_LEFT |
1 |
Left mouse button. |
BUTTON_RIGHT |
2 |
Right mouse button. |
BUTTON_MIDDLE |
3 |
Middle mouse button. |
(table) A table containing three boolean values that describe which modifier keys were held down while the mouse button was pressed. A modifier key is a key that can be held down while button is pressed, to "modify" it.
There are three true/false values in the table, one for each type of modifier key on the keyboard: shift, ctrl, and alt. You can access these values as e_Modifiers.shift, e_Modifiers.ctrl, and e_Modifiers.alt.
(number) The horizontal position of the mouse cursor when the mouse button was pressed, relative to the top left of the object.
(number) The vertical position of the mouse cursor when the mouse button was pressed, relative to the top left of the object.
(number) The horizontal position of the mouse cursor when the mouse button was pressed, relative to the top left of the page.
(number) The vertical position of the mouse cursor when the mouse button was pressed, relative to the top left of the page.
The actions that will be performed when the mouse moves within the bounds of your application or a QuickTime object.
(number) The horizontal position of the mouse cursor, in pixels, from the left side of the page or dialog.
(number) The vertical position of the mouse cursor, in pixels, from the right side of the page or dialog.
The following additional event variables are automatically set whenever this event is triggered for a QuickTime object:
(number) The index of the button that was pressed:
CONSTANT |
VALUE |
DESCRIPTION |
BUTTON_LEFT |
1 |
Left mouse button. |
BUTTON_RIGHT |
2 |
Right mouse button. |
BUTTON_MIDDLE |
3 |
Middle mouse button. |
(table) A table containing three boolean values that describe which modifier keys were held down while the mouse button was pressed. A modifier key is a key that can be held down while button is pressed, to "modify" it.
There are three true/false values in the table, one for each type of modifier key on the keyboard: shift, ctrl, and alt. You can access these values as e_Modifiers.shift, e_Modifiers.ctrl, and e_Modifiers.alt.
(number) The horizontal position of the mouse cursor when the mouse button was pressed, relative to the top left of the object.
(number) The vertical position of the mouse cursor when the mouse button was pressed, relative to the top left of the object.
The actions that will be performed when the mouse wheel is rotated while a page or dialog has focus.
The following event variables are automatically set whenever this event is triggered:
(table) A table containing five boolean values that describe which modifier keys or buttons were held down when the mouse wheel event was fired.
There are five true/false values in the table: shift key, ctrl key, left mouse button, middle mouse button, and right mouse button. You can access these values as e_Flags.shift, e_Flags.ctrl, e_Flags.LButton, e_Flags.MButton, and e_Flags.RButton.
(number) The distance that the mouse wheel was rotated. A negative value indicates that the mouse wheel was rotated backward towards the user, and a positive value indicates that the mouse wheel was rotated forward away from the user. This can be altered by the user via their mouse software. This value will usually be 120 or -120, however may be multiples or divisions of 120 depending upon the mouse vendor.
(number) The horizontal position of the mouse cursor, in pixels, from the left side of the page or dialog.
(number) The vertical position of the mouse cursor, in pixels, from the top of the page or dialog.
The actions that will be performed when the media file has finished playing in a QuickTime object.
The actions that will be performed whenever the URL changes (when it starts to navigate to a new page) in the web object.
The following event variables are automatically set whenever this event is triggered:
(string) A string containing the URL that is being navigated to.
The actions that will be performed whenever the video is paused in a video object, or slideshow is paused in a slideshow object.
The actions that will be performed whenever the video starts to play in a video object, or slideshow starts in a slideshow object.
The actions that will be performed right after the page or dialog is created in memory, before the page or dialog (or any of the objects on it) is shown.
You can use this event to set the initial visibility of each object on the page or dialog. Simply show or hide the objects according to whether they should start out visible or hidden. (By doing so before the page or dialog is displayed, you can avoid any visible "flickering" as the objects are hidden or shown.)
Note: Some actions (especially object-related actions) may not work properly on this event because it occurs before any of the page's objects are "created." If an action doesn't work at On Preload, try it at On Show instead.
The actions that will be performed when the play rate of the media file within a QuickTime object has changed.
The following event variables are automatically set whenever this event is triggered:
(number) The new rate of the media file.
The actions that will be performed when the user right-clicks this object.
The actions that will be performed when the user selects or deselects items in a listbox or combobox.
The following event variables are automatically set whenever this event is triggered through a combobox object:
(number) The index of the comboxbox item that is being selected. (The first item in the list has an index of 1.)
Note: This event is available for richtext and grid objects in your project.
The actions that will be performed when the selection changes in a richtext object.
The following event variables are automatically set whenever this event is triggered:
(number) The 1-based character index of the start of the selection.
(number) The 1-based character index of the end of the selection.
The actions that will be performed whenever the selection of cells in a grid object changes.
The following event variables are automatically set whenever this event is triggered:
(number) The row (0-based) of the cell that now has focus.
(number) The column (0-based) of the cell that now has focus.
The actions that will be performed whenever the page or dialog is opened (after the page or dialog is shown and the objects have been drawn).
The actions that will be performed whenever your AutoPlay application closes. The AutoPlay application can either be closed using the Application.Exit action or if the user clicked close button on the application title bar.
Tip: If you need to prevent the user from closing the application or want to add a confirmation message, you can use the built-in function QueryAllowProjectClose().
The actions that will be performed each time the slide changes in the slideshow object.
The following event variables are automatically set whenever this event is triggered:
(number) The 1-based index of the slide that was changed to in the slideshow (currently shown).
(string) The full path to the image file that was changed to in the slideshow (currently shown).
The actions that will be performed whenever the page or dialog changes size. For example, if the user maximizes the application's window, these actions will fire.
The following event variables are automatically set whenever this event is triggered:
(number) The width, in pixels, of the entire application window, including the border and title bar.
(number) The height, in pixels, of the entire application window, including the border and title bar.
(number) The width of the current page.
(number) The height of the current page.
(number) The width of the current dialog.
(number) The height of the current dialog.
(number) The type of resize that has occurred. Choose from:
CONSTANT |
VALUE |
DESCRIPTION |
SIZE_RESTORED |
0 |
The application was either restored from being maximized or minimized or was resized normally. |
SIZE_MINIMIZED |
1 |
The application was minimized to the taskbar. |
SIZE_MAXIMIZED |
2 |
The application was maximized. |
Tip: To make your project resizable, enable the resizable option on the Appearance tab of the Project Settings dialog (Project > Settings). Dialogs have their own resizable setting located on the Attributes tab of its properties dialog.
The actions that will be performed right after the user launches your AutoPlay application, before any pages or dialogs are initialized and shown.
Note: that some actions (especially object-related actions) may not work properly on this event because it occurs before any objects in the project are "created."
The actions that will be performed whenever the video is stopped in a video object.
The actions that will be performed whenever a page or dialog timer fires. You can start a page timer using a Page.StartTimer action, or a dialog timer using the DialogEx.StartTimer action.
The following event variable is automatically set whenever this event is triggered:
(number) The numeric ID of the page or dialog timer that has fired. This is the same ID that was passed to the Page.StartTimer or DialogEx.StartTimer action that created the timer. When using multiple timers, you can differentiate between them using if/elseif statements.