加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flex 查查你的号码归属地

发布时间:2020-12-15 04:59:48 所属栏目:百科 来源:网络整理
导读:?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="480" height="320"mx:WebService id="mobileWS" wsdl="http://www.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl"showBusyCu
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="480" height="320">
<mx:WebService id="mobileWS" wsdl="http://www.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl"
showBusyCursor="true" result="handleMobileCode(event)" fault="handleFault(event)"/>
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;

[Bindable]
private var arrMobile:ArrayCollection = new ArrayCollection();

private function searchMobile(event:MouseEvent):void{
btnSearch.enabled = false;
mobileWS.getMobileCodeInfo(tiMobile.text);
}
private function handleMobileCode(event:ResultEvent):void{
//trace(event.result);
btnSearch.enabled = true;
var str:String = String(event.result);
switch(str){
case "没有此号码记录":
Alert.show("没有此号码记录");
return;
break;
case "手机号码错误 http://www.webxml.com.cn":
Alert.show("手机号码错误");
return;
break;
}
var arr:Array = str.split(":");
var arr1:Array = arr[1].split(" ");
var len:uint = arr1.length;
if(arrMobile.length>0)
{
arrMobile = new ArrayCollection();
}
for(var i:uint = 0; i < len; i++){
arrMobile.addItem(arr1[i]);
}
}
private function handleFault(event:FaultEvent):void{
Alert.show("出现网络,请确保您的网络正常");
}
]]>
</mx:Script>
<mx:Panel id="panContainer" title="手机号码归属地查询" width="480" height="320" cornerRadius="4">
<mx:Label x="72" y="57" text="请输入手机号码:"/>
<mx:Button id="btnSearch" x="343" y="52" label="查询" click="searchMobile(event)"/>
<mx:TextInput id="tiMobile" x="184" y="51" enter="searchMobile(null)"/>
<mx:Label x="143" y="117" text="省份:"/>
<mx:TextInput id="tiProvince" text="{arrMobile.getItemAt(0)}" x="186" y="110" editable="false"/>
<mx:Label x="142" y="154" text="城市:"/>
<mx:TextInput id="tiCity" text="{arrMobile.getItemAt(1)}" x="186" y="148" editable="false"/>
<mx:Label x="142" y="190" text="类型:"/>
<mx:TextInput id="tiType" text="{arrMobile.getItemAt(2)}" x="186" y="184" editable="false"/>
</mx:Panel>
</mx:Application>


来源于:http://www.as3hope.com/read.php?60

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读