## DFrameAPI: preLoadImagesForButtonImage

preLoadImagesForButtonImage: Preload an image that can be used in the addButtonImage method.

Demo

file: addButtonImage.html

Run the example
See the source code

### Syntaxes

DFrameAPI. preLoadImagesForButtonImage (key, directoryPath,_
normalImg, rollImg, selectedImg, rollSelectedImg)

### Parameter

key

A string identifying the image.

directoryPath

String or array. The path of the directory containing the images.

If string: directory path is relative to the path set by dFrameFilePath. This directory path doesn't begin with a '/' as the dFrameFilePath ends with one.

if array:

array[0]: The directory path for icons. This directory path must be relative either the location of the page ('./subDir/' or '../../styles/blue/') or relative to the server's (or disk) root directory (/serverRoot/files/dFrame/styles/blue/)

array[1]: The 'A' keyword indicating an 'absolute' path.

In both cases the directory path ends with a '/'

normalImg

String. The file name of the image for the Button.

rollImg

String. The file name of the image to be shown when the mouse is over the Button.

selectedImg

String. The file name of the image to be shown when the Button is selected

rollSelectedImg

String. The file name of the image to be shown when the mouse is over a selected Button.

### Usage

This method is to be used outside the onLoad method of dFrameAPI so that the images are set as resources of dFrameAPI and it waits for those images before launching its onLoad method.