Best way to have an ASP/.NET ajax driven page updated using flex/flash?
I have a mapping application written in a flex/flash app. This app is used primarily to get bounding coordinates for the currently visible data on the map. I want to put this in an ASP page that is using ajax to update search results. The sea开发者_如何转开发rch results are defined by the bounding coordinates. Basically these bounding coordinates are the search query. What is the best way to update this search with the current coordinates from the flex app? I am not sure of the best way to have flex interact with the web page.
How do I tell my ajax driven ASP .net page to update results based on data from the flex app?
Use AS3 ExternalInterface class to communicate with JavaScript.
In AS3 :
private function sendData(boundingCoordinates:Object):void
{
if(ExternalInterface.available)
{
ExternalInterface.call("sendDataToASP", boundingCoordinates);
}
}
In JavaScript :
function sendDataToASP(boundingCoordinates)
{
// doAJAXStuffWithBoundingCoordinates();
}
Two ways the flex/flash app could interact with the web page or server is to connect to the hostingpage via javascript/jquery/ajax calls or to connect directly from flex/flash via a webservice.
精彩评论