[LEFT] [COLOR=#333333][FONT=Arial]I want to call js function on service response my code is as below[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial] [/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]when I run this in google chrome, If I click directJs button It works properly,[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]It open new window.[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]But when I call js(ExternalInterface ) from service response It stuck in popupblocker[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]My aim is to execute js function from service responce in google chrome browser[/FONT][/COLOR]
[COLOR=#333333][FONT=Arial]please guide with solution.
[/FONT][/COLOR]
<?xml version=“1.0” encoding=“utf-8”?>
<mx:Application xmlns:mx=“http://www.adobe.com/2006/mxml” layout=“vertical”>
<mx:Script>
<=!=[=C=D=A=T=A=[
import mx.messaging.messages.HTTPRequestMessage;
import mx.controls.Alert;
import com.adobe.serialization.json.JSON;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;
private function CallService():void
{
var myService:HTTPService = new HTTPService();
myService.addEventListener(ResultEvent.RESULT, ResultEventFunction);
myService.addEventListener(FaultEvent.FAULT,FaultEventFunction);
myService.useProxy = false;
myService.method = HTTPRequestMessage.GET_METHOD;
myService.url = "https://www.googleapis.com/books/v1/volumes?q=science";
myService.send();
}
private function ResultEventFunction(e:ResultEvent):void
{
ExternalInterface.call( "window.open", "http://www.google.com", "_blank" );
lbl.text = "service result";
}
private function FaultEventFunction(e:FaultEvent):void
{
ExternalInterface.call( "window.open", "http://www.google.com", "_blank" );
lbl.text = "service fault";
}
private function CallJS():void
{
ExternalInterface.call( "window.open", "http://www.google.com", "_blank" );
lbl.text = "direct js";
}
]=]=>
</mx:Script>
<mx:Button label="CallJS" click="CallJS()"/>
<mx:Button label="CallService" click="CallService()"/>
<mx:Label id="lbl"/>
</mx:Application>
[/LEFT]