Pessoal, será que alguem sabe pq está dando esse erro?
segue meu codigo
é um teste para trazer o endereço pelo resultado do cep.
o codigo ta bem feio
pq é um teste rápido.
vlwww
[code]<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=“http://www.adobe.com/2006/mxml” layout=“absolute”>
<mx:Script>
<![CDATA[
import flash.events.Event;
private function cepResult(event:ResultEvent):void{
var resultXML:XMLList = new XMLList(new XML(event.result));
if (resultXML != null && resultXML.retorno.resultado == 1){
this.txtLogradouro.text = new String(resultXML.retorno.tipo_logradouro + " " + resultXML.retorno.logradouro);
this.txtBairro.text = new String(resultXML.retorno.bairro);
this.txtCidade.text = new String(resultXML.retorno.cidade);
//this.comboUf.text = new String(resultXML.retorno.uf);
}else{
this.txtLogradouro.text = "";
this.txtBairro.text = "";
this.txtCidade.text = "";
//this.comboUf.selectedIndex = 0;
Alert.show("Cep não encontrado.", "Siart - Erro");
}
}
private function pesquisarCep(strCep:String):void{
//Função que envia o cep para o web service e aguarda o endereço.
if (strCep.length == 8){
var url: String;
url = "http:www.buscarcep.com.br/?formato=xml&cep=";
buscaCep.url = "http:www.buscarcep.com.br/?formato=xml&cep=" + strCep;
buscaCep.send();
}
}
]]>
</mx:Script>
<mx:HTTPService id="buscaCep" result="cepResult(event)" method="POST" showBusyCursor="true" resultFormat="e4x"/>
<mx:Form width="100%" height="100%" horizontalCenter="0" verticalCenter="0">
<mx:FormItem label="Label">
<mx:TextInput id="txtLogradouro"/>
</mx:FormItem>
<mx:TextInput id="txtBairro"/>
<mx:TextInput id="txtCidade"/>
<mx:TextInput id="comboUf"/>
<mx:FormItem label="cep">
<mx:TextInput id="txtCep" />
</mx:FormItem>
<mx:FormItem label="ok" id="ok">
<mx:Button label="Button" click="pesquisarCep(txtCep.text)"/>
</mx:FormItem>
</mx:Form>
</mx:Application>
[/code]
o erro que dá
é
Type was not found or was not compile-time cosntant: ResultEvent
vlw