Dekho Simulator

The Dekho Simulator project assumes that you will already have Dekho installed, configured and working.

To start using the Dekho Simulator you will need to import the project into Flash Builder.

Step 01> On the “Import Flash Project” form select the “Project folder:” option. Browse to the Dekho Simulator’s project folder and select the Ok button. Uncheck the “Use default location” check box and then click the Finish button.

To avoid any compatibility issues when working with custom tools you need to use the same Flex SDK version that Dekho was compiled with. To find out which SDK version Dekho was compiled you can open the About Dekho form, located on Dekho’s context menu.

Step 02> To set the projects SDK version, Right-Click on the project and select the properties option.

Step 03> On the left hand side of the “Properties for DekhoCustomToolSimulator” form click the Flex Compiler option. Next select the correct SDK version from the “Use a specific SDK” dropdown and click the Ok button.


If you don’t have the correct SDK version available you will need to add it. The different versions of the Flex SDKs are available from the same location as the Custom Tool examples.

Step 04> To add a new SDK version click on the “Configure Flex SDKs...” hyperlink at the right side of the form.

Step 05> Click the Add...

Step 06> Browse to the correct SDK version folder and click on the Ok button. The Flex SDK name should get populated automatically. Click the Ok button.

The new Flex SDK version should be listed with the other installed versions of the Flex SDKs. Click on the Ok button.

Step 07> Now you can select the correct SDK version for the project to use and then click the Ok button.

Step 08> You will get a popup warning message, click the Ok button.

To make creating and testing a custom tool easier the dekhosimulator.mxml file requires some small changes. The changes will allow you to avoid having to type the values in every time you want to test the custom tool.

Step 09> Expand the projects src folder, Right-Click on the dekhosimulator.mxml file and select the Open option.

Step 10> Scroll to the bottom of the file and change the value of the text input box with an id of dekhourl to a valid Dekho URL. The URL should be the installed version of Dekho that you already have setup on your system.

If you know the location and name of the custom tool you are testing you can also update the value of the text input box with an id value of customtoolurl.

If you want the ability to debug the custom tool you must use the custom tools customtoolname.swf file located in the projects bin-debug folder.

If you would like a map displayed while testing the custom tool or avoid having to type the maps URL in every time you can update the com/MapContainer.mxml file.

Step 11> Expand the projects com folder, Right-Click on the MapContainer.mxml file and select the Open option.


Scroll to the bottom of the file and change the value of the text input box with an id of mapurl to a valid ArcGIS Server dynamic map service URL.


Step 12> With all of the changes done, save the files and build the project. Now you are ready to run the project, to do that you can click on the debug tool. It’s the fifth tool over from the right.

If you entered a valid mapurl, when the project has loaded into the browser you should see a form at the top of the page and a map making up the rest of the page.

Before you can load a custom tool into the Dekho Simulator you have to open a channel to the Dekho Services and populate some start up settings. To do this click on the “set channel and get settings” button to the right of the Dekho URL textbox.




If a security error occurs when the “set channel and get settings” is clicked then a crossdomain.xml file to the root folder of the Dekho web site is probably required




After clicking the “set channel and get settings” button its label will change to “set and ready” and the “load custom tool” button will become enabled.

By clicking on the “load custom tool” button you will load the custom tool’s swf file and it will be display on the page.

Notice that the label for the “load custom tool” button has changed to “unload custom tool”. If you click the button again it will unload your custom tool from the simulator. Unloading the custom tool is helpful to test how well the custom tool cleans up after itself.

The Dekho Simulator also has a “call custom tool” button. The button becomes enabled once a custom tool has been loaded. The button is used to simulate messages passed to custom tools by Dekho.

To find out more about messages sent by Dekho or what message can be sent to Dekho see the section titled “Messages” in this document. To find out how a custom tool can receive Dekho messages see the section titled “The Custom Tool” in this document.

The Custom Tool

Adding the Custom Tool to Dekho