SetBackground()

Syntax:

SetBackground( ObjectName )

Parameters:

ObjectName – the name of an object that can contain any of the following properties:

Style – one of the Background styles you can create with this function. Style must be one of the following keywords: solid, linear, centre, circular, radial, spiral, spiral2, exponentialspiral or concentric. This property is optional. The keyword must be surrounded by quote marks or a variable containing one of the valid keywords.

Colour – the colour of the background. For a solid background style this is a single valid RGB value or a variable containing a valid RGB value. For any other gradient style (e.g. spiral) this is an array of RGB colour values – see example.

Note:
The RGB value can be calculated using the RGB function.

transparency – a percentage, showing the level of transparency for the background. transparency must be an integer between 0 and 100. This property is optional.

For non-solid styles, you can also set the following properties:

angle – the angle in degrees for linear, radial, spiral, spiral2 and exponentialspiral styles. angle must be a number between 0 and 359. This property is optional.

Note:
This property does not apply to centre, circular or concentric styles.

twist – the amount of twist to apply to spiral, spiral2 and exponentialspiral gradient styles. twist must be a number between 0 and 2. This property is optional.

bands – the number of bands for spiral, spiral2, exponentialspiral and concentric gradient styles. bands must be a number between 0 and 20. This property is optional.

offsetx – percentage from left to put centre of gradient for centre, circular, radial, spiral, spiral2, exponentialspiral and concentric gradient styles. offsetx must be a number between 0 and 100. This property is optional.

offsety – percentage from top to put centre of gradient for centre, circular, radial, spiral, spiral2, exponentialspiral and concentric gradient styles. offsety must be a number between 0 and 100. This property is optional.

startsize – the start size of the bands in spiral, spiral2, exponentialspiral and concentric gradient styles. startsize must be a number between 1 and 100. This property is optional.

Note:
All properties are optional and if they are not set, the SetBackground function will leave the property unchanged.

Remarks:

This function allows you to create the Background style and colour for a specified object by creating a new object and setting the properties you want to change. The new object containing your changes is entered in the objectName parameter and then applied to a specified object. There are two methods of using this function:

(i)  Specify an object name – in this method, the Background style will be set on the Normal (i.e. default) Object State.

(ii) Specify a new object created with the GetAppearance function – in this method, the Background style is set for the Object State of the object specified in the GetAppearance function.

Note:
The Background style can be removed using the RemoveBackground function or in the Background tab of the object’s Properties dialog.

image\Script_Button.jpgExamples