Previous

Description:

baPrevious checks whether a previous instance of a projector or packaged file is running.

Platforms:

Windows

Usage:

Result = baPrevious( Activate )

Arguments:

Integer.
If Activate is true, the previous instance is activated and brought to the front.

Returns:

Integer.
Returns the window handle of the previous instance if one is running, else 0.

Examples:

Director:
if baPrevious( true ) <> 0 then quit

Authorware:
if baPrevious( true ) <> 0 then quit(0)
 

Notes:

Both Director and Authorware open their display windows before scripts are executed. This means that the window of the second instance will appear before the previous one can be activated.

Under Windows NT/2000/XP/Vista, this function will only find the first instance opened. For example, if you open three copies of a projector, then quit the first one, baPrevious in the third projector will return 0 - it can not recognise the second projector as a previous instance. Under Windows 95 and 3.1, the third projector will be able to identify the second projector as a previous instance.

If you are running a full screen Director projector use this script to activate the previous instance. The example given above will make the stage move to a new position.

wnd = baPrevious( false )
    if wnd <> 0 then
        baWindowToFront( wnd )
    quit
end if