Frequently Asked Questions (FAQ) -- How to Setting XML file in FlashMapOne?

What is steps of setting attributes in XML file?
step 1, open the xml file in any text editor. step 2, find and sets your wanted attribute. step 3, save xml file. step 4 runs the swf file or html file review it.
What is the struct of a map?
see below picture:
What is the struct of XML file?
FlashMapOne XML file include 5 parts. There is <style_list>, <map_general>, <region_list>, <location_list>, <connection_list>.
  • <style_list> -- Define a style list which can be font, gradientfill, image. These style can be used in following attributes.
  • <map_general> -- Sets the general attributes of map in this tag, likes background color, region default color, default style, messagebox visual style etc.
  • <region_list> -- Define regions list and attributes in each region.
  • <location_list> -- Define locations list and attributes in each location.
  • <connection_list> -- Define connections list and attributes in each connection.
see below picture:
How to sets xml source for map in a web page?
two ways to sets xml source for map in a web page. first, can sets a xml file name for map, below is javascript code you can refrense the Your First Example :

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>FlashMapOne First Sample</title>
<script type="text/javascript" language="javascript" src="/js/mapone_swf.js"></script>
</head>
<body>
<div id="flashcontent">
<strong>You need to upgrade your Flash Player</strong>
This is replaced by the Flash content.
</div>

<script type="text/javascript">
// <![CDATA[

var so = new SWFObject("DN_World_Map.swf", "sotester", "750", "400", "9", "#FFFFFF");
so.addVariable("xmlvariable", "DN_World_Map.xml");
so.write("flashcontent");

// ]]>
</script>
</body>
</html>

second, can sets a xml text for map, below is javascript code:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>FlashMapOne First Sample</title>
<script type="text/javascript" language="javascript" src="/js/mapone_swf.js"></script>
</head>
<body>
<div id="flashcontent">
<strong>You need to upgrade your Flash Player</strong>
This is replaced by the Flash content.
</div>

<script type="text/javascript">
// <![CDATA[
var xmltext="<?xml version="1.0" encoding="utf-8"?>
<map>
<style_list>
<style id="ft_01" type="font" font_name="Arial" size="12" color="0x000033" align="left" italic="" bold="" underline="" />
<style id="ft_02" type="font" font_name="Roman" size="12" color="0x993300" align="left" italic="" bold="true" underline="" />
<!-- matrix: width:Number, height:Number, [rotation:Number], [tx:Number], [ty:Number] -->
<style id="gf_01" type="gradientfill" fillType="linear" colors="0x000055,0xffffff" alphas="15,15" ratios="0,255" matrix="100,100,0,0,0" spreadMethod="pad" interpolationMethod="RGB" focalPointRatio="0.9" />
<style id="gf_02" type="gradientfill" fillType="linear" colors="0x000011,0x1122CC,0x1122CC,0x000011" alphas="70,100,100,70" ratios="0,30,230,255" matrix="100,100,0,0,0" spreadMethod="pad" interpolationMethod="RGB" focalPointRatio="0.9" />
<style id="img_01" type="image" url="http://www.google.com/intl/en_ALL/images/logo.gif" />
<style id="img_02" type="image" url="logo.gif" />
</style_list>
<map_general>
<background color="" fillstyle="" />
<!-- active:true,false; -->
<region active="true" show_text="!short_name!" text_light="true" textfont="ft_01" color="0x1E79E7" fillstyle="gf_01" hot_color="0xD04104" hot_fillstyle="gf_01" border_color="0xAFBEFC" />
<!-- label_pos:up,down,left,right; -->
<location image="" width="15" height="15" heightz="true" textfont="ft_01" border_color="" label_pos="down" color="0x000033" fillstyle="" hot_color="0xFF0011" hot_fillstyle="" />
<!-- line_type:soild,dashed; connect_type:curve(only soild),line;-->
<connection line_width="2" line_type="soild" connect_type="curve" color="0x0011FE" fillstyle="" hot_color="0xFF0011" hot_fillstyle="" />
<tooltip background_color="" background_fillstyle="gf_01" textfont="ft_01" text_light="true" />
<description background_color="0xCCCCCC" background_fillstyle="05" textfont="01" text_light="" />
<!--close_button_size: x,y,width,height -->
<messagebox width="200" height="200" border_color="0x2222dd" bar_color="0x6666CC" bar_visible="true" bar_height="20" close_button_size="178,2,20,15" close_button_color="0x6666CC" close_button_hot_color="0xFF66CC" background_color="0xDDDDDD" background_fillstyle="gf_01" textfont="ft_01" text_light="true" msgbox_css="" />
<animated hot_region="true" hot_region_border="true" tooltip_description_in="true" messagebox_in="false" />
</map_general>
<region_list>
<region id="DN_NA" name="NorthAmerica" short_name="NA" show_text="" active="" value="" color="" fillstyle="" hot_color="" hot_fillstyle="" border_color="" link_type="" link="" msgbox_text_url="" msgbox_text="msgbox text" msgbox_css="" msgbox_bk_image="" tooltip="NorthAmerica" description="" />
<region id="DN_SA" name="SouthAmerica" short_name="SA" show_text="" active="" value="" color="" fillstyle="" hot_color="" hot_fillstyle="" border_color="" link_type="" link="" msgbox_text_url="" msgbox_text="msgbox text" msgbox_css="" msgbox_bk_image="" tooltip="SouthAmerica" description="" />
<region id="DN_EU" name="Europe" short_name="EU" show_text="" active="" value="" color="" fillstyle="" hot_color="" hot_fillstyle="" border_color="" link_type="" link="" msgbox_text_url="" msgbox_text="msgbox text" msgbox_css="" msgbox_bk_image="" tooltip="Europe" description="" />
<region id="DN_AS" name="Asia" short_name="AS" value="" fillstyle="" color="#FF0000" border_color="" hot_color="" link_type="" msgbox_text_url="" msgbox_text="msgbox text" link="http://www.flash-map-one.com" tooltip="" description="" />
<region id="DN_AF" name="Africa" short_name="AF" show_text="" active="" value="" color="" fillstyle="" hot_color="" hot_fillstyle="" border_color="" link_type="" link="" msgbox_text_url="" msgbox_text="msgbox text" msgbox_css="" msgbox_bk_image="" tooltip="Africa" description="" />
<region id="DN_AU" name="Australia" short_name="AU" show_text="" active="" value="" color="" fillstyle="" hot_color="" hot_fillstyle="" border_color="" link_type="" link="" msgbox_text_url="" msgbox_text="msgbox text" msgbox_css="" msgbox_bk_image="" tooltip="Australia" description="" />
</region_list>
<location_list>
<!--link_type _blank,_self..--open a URL// abel_pos:up,down,left,top -->
<!-- example of location
<location id="L_ID_1" label="label" label_pos="" image="" x_pos="" y_pos="" width="" height="" name="" short_name="" value="" color="" fillstyle="" hot_color="" hot_fillstyle="" border_color="" link_type="" link="" msgbox_text_url="" msgbox_text="msgbox text" msgbox_css="" msgbox_bk_image="" tooltip="" description="" />
<location id="L_ID_2" label="label" label_pos="" image="" x_pos="" y_pos="" width="" height="" name="" short_name="" value="" color="" fillstyle="" hot_color="" hot_fillstyle="" border_color="" link_type="" link="" msgbox_text_url="" msgbox_text="msgbox text" msgbox_css="" msgbox_bk_image="" tooltip="" description="" />
-->
</location_list>
<connection_list>
<!--line_type: soild, dashed; connect_type:line,curve;-->
<!-- example of connection
<connection id="C_ID_1" connect_points="L_ID_1,L_ID_2" line_width="" connect_type="" line_type="dashed" name="" short_name="" value="" color="" fillstyle="" hot_color="" hot_fillstyle="" border_color="" link_type="" link="" msgbox_text_url="" msgbox_text="msgbox text" msgbox_css="" msgbox_bk_image="" tooltip="" description="" />
-->
</connection_list>
</map>" ;
var so = new SWFObject("DN_World_Map.swf", "sotester", "750", "400", "9", "#FFFFFF");
so.addVariable("xmltext", xmltext);
so.write("flashcontent");

// ]]>
</script>
</body>
</html>

How to sets color(or other attributes) apply to all regions in map?
You can sets the attribute in <map_general>..</map_general> if you want apply which attribute apply to all regions. e.g. sets color to red(#FF0000) of all regions, below is:
<map_general>
...
    <region ... color="0xFF0000"... />
...
</map_general>
How to sets color(or other attributes) for a specific region in map?
e.g. sets color to red(#FF0000) of region which id be "SA", below is:
<region_list>
...
    <region id="SA"... color="0xFF0000"... />
...
</region_list>
How to sets show text for region?
show_text support "variable swith". variable can be "short_name", "value","name". see the example. e.g. sets show_text to "short_name:$vaule" for all regions, below is:
<map_general>
...
    <region ... show_text="!short_name!:$!value!"... />
...
</map_general>
e.g. sets show_text to "profit:$vaule" for region which id be "SA", below is:
<region_list>
...
    <region id="SA" ... show_text="profit:$!value!"... />
...
</region_list>
How to sets hot color for region when mouse over it?
e.g. sets hot color to blue(#0000FF) for all regions, below is:
<map_general>
...
    <region ... hot_color="0x0000FF"... />
...
</map_general>
e.g. sets hot color to blue(#0000FF) for region which id be "SA", below is:
<region_list>
...
    <region id="SA" ... hot_color="0x0000FF"... />
...
</region_list>
How to apply gradientfill style in map?
the first, define a gradientfill style in <style_list> which id is "gf_01", below is:
<style_list>
...
    <style id="gf_01" type="gradientfill" fillType="linear" colors="0x000055,0xffffff" alphas="15,15" ratios="0,255" matrix="100,100,0,0,0" spreadMethod="pad" interpolationMethod="RGB" focalPointRatio="0.9" />
...
</style_list>
now you can sets this gradientfill style to a region or all regions and anywhere in map. e.g. sets this gradientfill for region which id be "SA", below is:
<region_list>
...
    <region id="SA" ... fillstyle="gf_01"... />
...
</region_list>
How to apply font style in map?
the first, define a font style in <style_list> which id is "ft_01", below is:
<style_list>
...
    <style id="ft_01" type="font" font_name="Arial" size="12" color="0x000033" align="left" italic="" bold="" underline="" />
...
</style_list>
now you can sets this font to regions show text and anywhere in map. e.g. sets this font for regions show text, below is:
<map_general>
...
    <region ... textfont="ft_01"... />
...
</map_general>
How to background for map?
sets to color(0xff00ff), below is:
<map_general>
...
    <background color="0xff00ff" />
...
</map_general>
sets to gradientfill, first define a gradientfill style in <style_list> which is "gf_01", then below is:
<map_general>
...
    <background fillstyle="gf_01" />
...
</map_general>
sets to a image. first define a image style in <style_list> which is "img_01", then below is:
<map_general>
...
    <background fillstyle="img_01" />
...
</map_general>
How to sets content for messagebox?
sets a simple text to show in messagbox for region which id is "SA", below is:
<region_list>
...
    <region id="SA" ... msgbox_text="show me in messagbox!" msgbox_text_url=""... />
...
</region_list>
sets a text or html file to show in messagbox for region which id is "SA", e.g. the file name is msg_sa.html, below is:
<region_list>
...
    <region id="SA" ... msgbox_text="" msgbox_text_url="msg_sa.html"... />
...
</region_list>
apply to a css style file for show text in messagbox for region which id is "SA", e.g. the css file name is css_sa.html, below is:
<region_list>
...
    <region id="SA" ... msgbox_text="" msgbox_text_url="msg_sa.html" msgbox_css="css_sa.html"... />
...
</region_list>
How to sets visual style for messagebox?
can sets visual style for messagbox in below attributes:
<map_general>
...
    <messagebox width="200" height="200" border_color="0x2222dd" bar_color="0x6666CC" bar_visible="true" bar_height="20" close_button_size="178,2,20,15" close_button_color="0x6666CC" close_button_hot_color="0xFF66CC" background_color="0xDDDDDD" background_fillstyle="gf_01" textfont="ft_01" text_light="true" msgbox_css="" />
...
</map_general>
How to sets link url for region?
sets open url to "http://www.flash-map-one.com" for region which id is "SA", below is:
<region_list>
...
    <region id="SA" ... link="http://www.flash-map-one.com" link_type="_blank"... />
...
</region_list>
How to sets tooltip text for region?
sets tooltip text "show me in tooltip for sa region" for region which id is "SA", below is:
<region_list>
...
    <region id="SA" ... tooltip="show me in tooltip for sa region"... />
...
</region_list>
How to sets description text for region?
sets description text "show me in description for sa region" for region which id is "SA", below is:
<region_list>
...
    <region id="SA" ... description="show me in tooltip for sa region"... />
...
</region_list>
What is location and how to use it?
location is a maker locates by x,y in map. can shows a image and a label in it. define a location in map, below is:
<location_list>
...
    <location id="L_ID_1" label="label text " label_pos="" image="" x_pos="" y_pos="" width="" height="" name="" short_name="" value="" color="" fillstyle="" hot_color="" hot_fillstyle="" border_color="" link_type="" link="" msgbox_text_url="" msgbox_text="msgbox text" msgbox_css="" msgbox_bk_image="" tooltip="" description="" />
...
</location_list>
location's attributes similar to region, but location can be located with x, y by user self.
sometimes, region and location will boths hotting the mouse event when them in same position, so you can sets the active="false" of regions to solve this problem. below is:
<map_general>
...
    <region active="false" />
...
</map_general>
What is connection and how to use it?
connection can connects some locations with line, curve in a map. the first, define two or more location in map, below is:
<location_list>
...
    <location id="L_ID_1" label="label 1 " label_pos="" image="" x_pos="" y_pos="" width="" height=""... />
    <location id="L_ID_2" label="label 2 " label_pos="" image="" x_pos="" y_pos="" width="" height=""... />
...
</location_list>
then define a connection which connect from L_ID_1 to L_ID_2, below is:
<location_list>
...
    <connection id="C_ID_1" connect_points="L_ID_1,L_ID_2" line_width="" connect_type="" line_type="dashed" name="" short_name="" value="" color="" fillstyle="" hot_color="" hot_fillstyle="" border_color="" link_type="" link="" msgbox_text_url="" msgbox_text="msgbox text" msgbox_css="" msgbox_bk_image="" tooltip="" description="" />
...
</location_list>
sometimes, region and connection will boths hotting the mouse event when them in same position, so you can sets the active="false" of regions to solve this problem. below is:
<map_general>
...
    <region active="false" />
...
</map_general>