Sto provando ad eseguire del javascript con flex 4, ed actionscript 3 ma non viene eseguito niente.
codice:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="start();">
<mx:Script>
<![CDATA[
import flash.net.*;
import flash.external.ExternalInterface;
import flash.html.HTMLLoader;
import mx.controls.Alert;
public function start():void {
var html:HTMLLoader = new HTMLLoader;
html.width = 400;
html.height = 200;
var urlReq:URLRequest = new URLRequest("http://www.google.com");
html.load(urlReq);
if(ExternalInterface.available){
//Alert.show('ExternalInterface available');
ExternalInterface.call("alert('This is javascript called by flex on linux')");
} else {
Alert.show('ExternalInterface is not available');
}
}
]]>
</mx:Script>
<mx:Button id="button1" click="start()" label="START!" />
</mx:Application>
parte e non succede niente. La richiesta a google, non viene neanche eseguita, ho guardato con uno sniffer per le richieste http.
Che faccio?