The ArcWeb Explorer JavaScript to Flex Bridge gives JavaScript developers direct access to almost all ArcWeb Explorer Flex API functionality, plus some additional convenience methods.
For Bridge reference documents, see the Flex API reference documents. The Bridge is the same as the Flex API with the differences noted below. See ArcWeb Explorer JavaScript to Bridge API Reference for links to the API reference documents.
NOTE: Make sure you access your application through http:// URLs rather than file:// URLs. ArcWeb API Key authentication and/or the Flash Player security sandbox may prevent it from working correctly if accessed as a local file.
<script type="text/javascript" src="http://api.arcwebservices.com/awx/v4/awxbridge-4.0.1.js"></script>
<div id="awx" style="width: 100%; height: 80%"> Map goes here.</div>
function onBodyLoad()
{
AWXBridge.insertFramework("awx", {apiKey:"<ArcWeb Explorer API Key>"'});
}
function onCreationComplete() { }
m_root = FABridge.awx.root();
m_map = m_root.createMap();
m_root.addChild(m_map);
This basic example shows how to use the ArcWeb JavaScript to Flex Bridge.
To get the value of a property, call it like a function; use the same syntax to access objects by id, as the following example shows:
var currentScale = m_map.getScale();
Compare this to the Map properties in Flex where
the property is listed as "scale" rather than "getScale(). Where Flex API uses m_map.scale, the JavaScript to Flex Bridge
uses m_map.getScale().
To set the value of a property from JavaScript, call the function setPropertyName(), as the following example shows:
m_map.setScale(500000);
ArcWeb Explorer JavaScript to Flex Bridge overview
ArcWeb Explorer JavaScript to Bridge live samples
Troubleshooting the JavaScript to Flex Bridge
Visit the Feedback page to give comments or suggestions about the ArcWeb Explorer Developer's Guide.