It is possible to add script to a mimic that resides outside the bounds of any named function. This code will be run on load of the mimic, irrespective of whether the mimic is in design or run mode.
In some cases, this "feature" has been used as a mechanism to redirect from one page to another by adding the line Mimic.Navigate "xyz".
|If you create the redirect this way, then the mimic on which the redirect is configured is now effectively no longer editable. You can never open the mimic again to make any changes. As soon as you try to open it, it is immediately redirected to the other page.|
The best way to approach this is to use the built-in Mimic_Load functions. This function is run when the mimic loads, but only if it is in run mode. If you right click on the mimic and open it in design mode, then you will be able to open it and modify the script as required.
It is recommended that global code (code outside the named functions) is only used for things such as variable initialisation etc, and NEVER for mimic redirects using hyperlinks. An example function is shown below...