XML Map / Store / Dealer Locator – Canada
This is an XML map created in AS3 . It is to locate stores, dealers, people by state. It supports an unlimited amount of items per state, or even unlimited states.
The file includes:
- Unlimited entries
- Dynamic scroll bar (with mouse wheel)
- Inactive states (meaning no locations)
- Tooltips
- Easily changeable properties
- Company / Name
- Address One and Two
- City
- Zip code
- State
- Phone Number
- Web link
Interested in how to implement this file into your? Piece of cake!
- Step 1: Copy everything in the library and paste it into yours. Drag a copy of the MAIN _MAP_MC to the stage.
- Step 2: Be sure to copy the ‘com’ folder to your project folder so the map can find the necessary classes.
- Step 3 (optional): If for some reason you need to create another instance of the map, simply type the content below:
import com.ronnieswietek.map.CanadaStoreLocator; var storeLocator = new CanadaStoreLocator(); addChild(storeLocator);
- Step 4 (optional): These are the default properties, but you can even set your own properties directly in the actionscript panel like below:
storeLocator.xmlPath = "stores.xml"; storeLocator.windowOpenType = "_blank"; storeLocator.storeSpacing = 105; storeLocator.inactiveColor = 0x43493b; storeLocator.mapColor = 0x707864; (requires you to change tint on the state MC itself as well) storeLocator.rollOverColor = 0x869f61; storeLocator.rollOverDuration = 0; storeLocator.rollOverDelay = 0; storeLocator.rollOutColor = storeLocator.mapColor; storeLocator.rollOutDuration = 0.5; storeLocator.rollOutDelay = 0.3;
Adding a new “state”
To add a new “state”, simply copy a whole node like so:
<state movieclipname="alberta" displayname="Alberta"> <location city="city1" address1="123 Valley Parkway" company="company 1" linkdisplay="www.flashden.net" zip="92027" address2="" website="http://activeden.net/user/rondog" phone="800-888-8888" /> </state>
paste it at the bottom. Change the movieClipName to the name of another “state” on your map. Lets say we do
Guam:
<state movieclipname="guam" displayname="Guam"> <location city="city1" address1="123 Valley Parkway" company="company 1" linkdisplay="www.flashden.net" zip="92027" address2="" website="http://activeden.net/user/rondog" phone="800-888-8888" /> </state>
I have created a new node for guam. Now I need to go into my FLA , into MAIN _MAP_MC and add a movie clip called guam. Thats it!