toTop

Displays the object above all others in the same container. Object display is layered. If objects overlap, higher layers are drawn over lower layers.

Syntax

ogscript.toTop (ID);

Parameters

Parameter

Type

Required

Description

ID

String

Yes

ID object to be sent to the top

Returns

N/A

Example

This example includes two labels occupying the same position. LabelTwo is defined second in the code, so it appears on top and is therefore visible. Button One runs a task that uses ogscript.toTop to send Label One to the top of the stack. This makes Label One visible. Button Two sends Label Two to the top.

<abs>

<label height="317" id="labelOne" left="100" name="Label One" style="size:Biggest;bg#selectbg;txt-align:center;" top="100" width="350"/>

<label height="317" id="labelTwo" left="100" name="Label Two" style="size:Biggest;bg#D92648;txt-align:center;" top="100" width="350"/>

<button buttontype="push" height="40" id="oneTop" left="150" name="Button One" style="bg#selectbg;txt-align:center;" top="450" width="100">

<task tasktype="ogscript">ogscript.toTop('labelOne');

</task>

</button>

<button buttontype="push" height="40" id="twoTop" left="300" name="Button Two" style="bg#D92648;txt-align:center;" top="450" width="100">

<task tasktype="ogscript">ogscript.toTop('labelTwo');

</task>

</button>

</abs>