Frequently Asked Questions (FAQ) -- How to Setting XML file in FlashMapOne?
- What is steps of setting attributes in XML file?
- What is the struct of a map?
- What is the struct of XML file?
- How to sets xml source for map in a web page?
- How to sets color(or other attributes) apply to all regions in map?
- How to sets color(or other attributes) of a specific region in map?
- How to sets show text for region?
- How to sets hot color for region when mouse over it?
- How to apply gradientfill style in map?
- How to apply font style in map?
- How to sets background for map?
- How to sets content for messagebox?
- How to sets visual style for messagebox?
- How to sets link url for region?
- How to sets tooltip text for region?
- How to sets description text for region?
- What is location and how to use it?
- What is connection and how to use it?
- <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.
<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>
<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>
...
<region ... color="0xFF0000"... />
...
</map_general>
...
<region id="SA"... color="0xFF0000"... />
...
</region_list>
...
<region ... show_text="!short_name!:$!value!"... />
...
</map_general>
...
<region id="SA" ... show_text="profit:$!value!"... />
...
</region_list>
...
<region ... hot_color="0x0000FF"... />
...
</map_general>
...
<region id="SA" ... hot_color="0x0000FF"... />
...
</region_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>
...
<region id="SA" ... fillstyle="gf_01"... />
...
</region_list>
...
<style id="ft_01" type="font" font_name="Arial" size="12" color="0x000033" align="left" italic="" bold="" underline="" />
...
</style_list>
...
<region ... textfont="ft_01"... />
...
</map_general>
...
<background color="0xff00ff" />
...
</map_general>
...
<background fillstyle="gf_01" />
...
</map_general>
...
<background fillstyle="img_01" />
...
</map_general>
...
<region id="SA" ... msgbox_text="show me in messagbox!" msgbox_text_url=""... />
...
</region_list>
...
<region id="SA" ... msgbox_text="" msgbox_text_url="msg_sa.html"... />
...
</region_list>
...
<region id="SA" ... msgbox_text="" msgbox_text_url="msg_sa.html" msgbox_css="css_sa.html"... />
...
</region_list>
...
<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>
...
<region id="SA" ... link="http://www.flash-map-one.com" link_type="_blank"... />
...
</region_list>
...
<region id="SA" ... tooltip="show me in tooltip for sa region"... />
...
</region_list>
...
<region id="SA" ... description="show me in tooltip for sa region"... />
...
</region_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>
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:
...
<region active="false" />
...
</map_general>
...
<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>
...
<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>
...
<region active="false" />
...
</map_general>