Back to amMap.com

Movies

Movies are swf, jpg, gif or png files which are loaded on top of the map. Movies can contain other movies, lines or labels.

There are several embedded movies, which you don't need to load: rectangle, circle, border, target, home.

In the ammap/icons folder of the ammap package you can find a lot of swf files which can be loaded and used for different purposes. If you want to how a lot of cities on top of the map, it is recommended to use build-in movies, such as circle or target, as the map will work much faster with these movies.

Movies should be placed in <movies> node:

<code xml> <movies>

<movie file="icons/pin.swf" title="Moscow" lat="55.7558" long="37.6176" width="10" height="10" fixed_size="true">
  <description><![CDATA[<b>Some html formatted description can be placed here</b>]]></description>
</movie>
<movie file="rectangle" x="0" y="0" width="100%" height="50" color="#CC0000"></movie>

</movies> <code>

In the example above there are two movies described. The first one loads external file, pin.swf. The position of this movie is described with lat (latitude) and long (longitude). This means the icon is bounded to a map and will move together with it when zooming and moving.

The second movie uses build-in movie, "rectangle". The position of this movie is described using x and y attributes. This means, the position of the movie is fixed and will not change while moving the map.

Below are all available movie properties (attributes)

NameTypeIf not setDescription
fileString File name of a movie. This file should be placed in "path" folder (defined in map html file). If you want to use embedded movie, set movie name here: file="rectangle" (circle, border, target, home)
x, yNumber, Number% or !Number If you want your movie to be bounded to the stage, set x and y properties. This means that this movie will not move together with the map. To find desired x and y, use developer mode.
lat, longNumber If you want your movie to be bounded to the map, set lat and long (latitude and longitude) properties. This means that this movie will move together with the map. To find desired lat and long, use developer mode.
width, heightNumber or Number% Width and height of your movie. If you want to keep original size, do not set these properties.
rotationNumber Movie clip rotation in degrees.
fixed_sizetrue / falsefalse"false" means that the movie will be resized together with the map (when zooming). If you want your movie to remain the same size, set this property to "true".
centertrue / falsefalse"true" means that the movie center will be in specified longitude & latitude (or x & y). Otherwise movie's top left corner will be in this position. It is recommended to set "true" for photos, images and custom swf movies. However default amMap icons are made so that the icon's center is in 0,0 position, that's why you shouldn't set this setting to "true" when you use these icons.
remaintrue / falsetrue"true" means that this movie will remain visible when user clicks on it or on other objects in the same level. If your movie clip has child objects, you might want to make it invisible - set this property to "false" then.
oidString Unique object id. You only need it if you want to make "link" from one object to another.
colorHex color code If you do not set color, the movie will keep its original color.
color_hoverHex color code Movie color when user roll-overs it. Movie will not change color if this property is not set.
alphaNumber100Opacity of a movie. 0 for invisible (but still clickable).
titleString Movie title. Title can be displayed in a roll-over balloon.
urlString There are several options: 1) web site address: http://www.ammap.com 2) JavaScript function: javascript:alert('movie clicked'); 3) #top - will go to top level of your map 4) #parent - will go one level up 5) #object_id - will act as if object with oid="object_id" was clicked
targetString Target of url. Will work only if url is web site address. Do not set any target if you want this page to be opened in the same window. For a new window use "_blank".
flash_varsString If you use amMap on a web server, you can pass variables to your movies by adding them to your file name, for example: file="movie.swf?id=50&color=#CC0000". However if you open ammap as a stand alone flash project, this method will not work. The parameter "flash_vars" will help you to solve this problem. You can pass any number of variables to your movie: flash_vars="id=10&color=#CC0000".
valueNumber Value of the movie. Value can be displayed in a roll-over balloon.
zoom_x, zoom_y, zoomNumber% You should set zoom_x, zoom_y and zoom if you want map to be zoomed or moved to a different position when user clicks on the movie. To find out these values, turn developer mode on, set desired zoom level and position, copy "zoom info" to clipboard and paste it into movie node. If your movie has zoom, lat and long attributes but doesn't have zoom_x and zoom_y, the map will also soom-in to the given longitude and latitude.
text_boxtrue / false<settings><text_box><enabled>Text box displays description of your movie. If your movie has description, but you don't want text box to appear, set this attribute to false.
text_box_xNumber, Number% or !Number<settings><text_box><x>Text box x position.
text_box_yNumber, Number% or !Number<settings><text_box><x>Text box x position.
text_box_widthNumber or Number%<settings><text_box><width>Text box width.
text_box_heightNumber or Number%<settings><text_box><height>Text box height.
balloontrue / falsetrueIf you want to disable roll over balloon for your movie, set this attribute to false.
link_withother objects' oid attributes, separated by commas If you want some other objects to change color when user rolls over or clicks on this movie, you can add object's ids (oid) here.
activetrue / falsetrueIf set to "false" the movie will be invisible to mouse events (hover, click, etc.) even if behavior associated with it is set - the mouse will rather interact with underlying map. This feature will allow you to create map overlays that do not interfear with the map functionality.

Hint: if you add ! before the number for x, y, text_box_x and text_box_y, the position will be calculated from the opposite side.

Back to top