Back to amMap.com

Function list

Functions that control the map

flashMovie.setData(data)

This function can be used for setting the maps's data on the fly. Data must be in XML form. Just like in data files.


flashMovie.setSettings(settings)

This function can be used to set multiple (or a single) setting at a runtime. The settings must be passed in XML form, using the same names as in settings file. The settings string must not contain line breaks, double quotes must be replaced with single quotes. For example:

flashMovie.setSettings("<settings><background><color>#CC0000</color><alpha>100</alpha></background></settings>");

flashMovie.rebuild()

This function will rebuild the map. If you set some settings using setSettings() function, then you can use this function to redraw the map after several portions of settings were set.


flashMovie.reloadData([file_name])

This function will reload the data. The file_name variable is optional, if you do not set it here, data from the original file will be reloaded. You can set a new data file every time you call this function.


flashMovie.reloadSettings([file_name])

This function will reload the settings. The file_name variable is optional, if you do not set it here, settings from the original file will be reloaded. You can set a new settings file every time you call this function.


flashMovie.reloadAll([data_file_name][,settings_file_name])

This function will reload both data and settings. The names of the files are optional, if you do not set them, the original file names will be used.


flashMovie.setParam(param, value)

This function lets you change a single setting. The parameter names are formed using the section name and the parameter name, separated with a period. For example, the background opacity setting is:

<background>
  <alpha></alpha>

The parameter name will be: background.alpha

Or, the legend key size setting is:

<legend>
  ....
  <key>
     <size></size>

The parameter name will be: legend.key.size


flashMovie.getParam(param)

This function will ask Flash to return the value of a setting. The parameter name is formed in the same way as the setParam function (described above). When you call this function to return the setting value, Flash will call the amReturnParam(map_id, param) function.


flashMovie.getData()

This function will ask Flash to return the whole data. When you call this function to return the data, Flash will call the amReturnData(map_id, data) function.


flashMovie.getSettings()

This function will ask Flash to return the whole settings XML. When you call this function to return the data, Flash will call the amReturnSettings(map_id, settings) function.


flashMovie.exportImage([file_name])

This function will start the process of exporting the map as an image. The file_name is a name of a file to which image data will be posted (files provided in the download package are export.php and export.aspx). The file_name is optional and can be set in the <export_as_image><file> setting.


flashMovie.print()

This function will print the map. Use this print function if you don't have any values rotated by 90 degrees, also if you don't have a custom bitmap background.


flashMovie.printAsBitmap()

Another print function. Use it if you have values rotated by 90 degrees and/or a custom bitmap background.


flashMovie.setZoom(zoom_level, zoom_x, zoom_y, instant)

This function will set the new zoom level and position for the map. "instant" can be "true" or "false". If set to "true", the map will change the zoom position instantly, without animation. The default value is "false".


flashMovie.setZoomLongLat(zoom_level, longitude, latitude, instant)

This function will set the new zoom level and position for the map using longitude and latitude. "instant" can be "true" or "false". If set to "true", the map will change the zoom position instantly, without animation. The default value is "false".


flashMovie.getLongLat()

This function will return longitude and latitude of the mouse pointer. The values will be returned by calling amSetLongLat(map_id, long, lat) function


flashMovie.getStageXY()

This function will return x and y position of a mouse in pixels and in percents. The values will ve returned by calling amSetStageXY(map_id, x, y, x_percent, y_percent) function.


flashMovie.getZoomInfo()

This function will return map zoom level and zoom position. The values will be returned by calling amSetZoomInfo(map_id, x, y, level) function.


flashMovie.getCenterCoords()

This function will return center coordinates of the center of the currently visible map portion. The values will be returned by calling amSetCenterCoords(map_id, long, lat, level) function.


flashMovie.getCurrentBounds()

This function will return SW and NEW coordinates of the currently visible map portion. The values will be returned by calling amSetCurrentBounds(map_id, sw_lng, sw_lat, ne_lng, ne_lat) function.


flashMovie.clickObject(id)

This function will act as if user clicked on some object - area, movie or label. The object must have oid attribute set, for example: <area oid="UK" …..>


flashMovie.zoomIn()

The map will zoom-in by one step. You can call this function on mouseWheel event. amMap has a possibility to zoom-in and out with mouseWheel, however it is not working properly with wmode set to "transparent" or "opaque".


flashMovie.zoomOut()

The map will zoom-out by one step. You can call this function on mouseWheel event. amMap has a possibility to zoom-in and out with mouseWheel, however it is not working properly with wmode set to "transparent" or "opaque".


flashMovie.setColor(id, color)

This function sets the color of the object with the respective oid attribute .

Functions that are called by the map

amMapCompleted(map_id)

This function is called when the map is fully loaded and initialized.


amProcessCompleted(map_id, process_name)

This function is called when the map finishes doing some task triggered by another JavaScript function.


amReturnData(map_id, data)

This function is called when you request data from a mapby calling the flashMove.getData() function.


amReturnParam(map_id, param)

This function is called when you request a setting from a map by calling the flashMovie.getParam(param) function.


amReturnSettings(map_id, settings)

This function is called when you request settings from a map by calling the flashMove.getSettings() function.


amReturnImageData(map_id, data)

When exporting map as an image, the map passes image data to this function.


amError(map_id, message)

This function is called when an error occurs, such as no data, or file not found.


amSetLongLat(map_id, long, lat)

This function is called by the chart when you request this information by calling getLongLat() function.


amSetStageXY(map_id, x, y, x_percent, y_percent)

This function is called by the chart when you request this information by calling getStageXY() function.


amSetZoomInfo(map_id, x, y, level)

This function is called by the chart when you request this information by calling getZoomInfo() function.


amSetCenterCoords(map_id, long, lat, zoom)

This function is called by the chart when you request this information by calling getCenterCoords() function.


amSetCurrentBounds(map_id, sw_lng, sw_lat, ne_lng, ne_lat)

This function is called by the chart when you request this information by calling getCurrentBounds() function.


amRegisterClick(map_id, long, lat)

This function is called when user clicks on some object - area, movie or label.


amRegisterClickAnywhere(map_id, object_id, title, value)

This function is called when user clicks on some object - area, movie or label.


amRegisterHover(map_id, object_id, title, value)

This function is called when user rolls-over on some object - area, movie or label.


Back to top