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

【百行代码话应用】flex WebService应用之QQ在线客服实现

发布时间:2020-12-15 05:03:52 所属栏目:百科 来源:网络整理
导读:1.应用了flex中的webservice 组件,来调用QQ在线监测的接口? qqwebService.qqCheckOnline(qq_id.text);??? qq_id.text 为输入的QQ号码 返回“Y” 表示在线,“N”表示离线 2.调用QQ在线聊天的借口,用来激发聊天框navigateToURL(new URLRequest("http://wpa.

1.应用了flex中的webservice 组件,来调用QQ在线监测的接口? qqwebService.qqCheckOnline(qq_id.text);??? qq_id.text 为输入的QQ号码

返回“Y” 表示在线,“N”表示离线

2.调用QQ在线聊天的借口,用来激发聊天框navigateToURL(new URLRequest("http://wpa.qq.com/msgrd?v=3&uin="+int(qq_id.text)+"&site=qq&menu=yes"),"_blank");

?

?

?

?

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:local="*">
	<fx:Declarations>
		
		<mx:WebService id="qqwebService" wsdl="http://webservice.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl"
					   showBusyCursor="true" result="onLoad2(event)" fault="faultHandler2(event)"/>
	</fx:Declarations>
	<fx:Script> 
		<![CDATA[ 
			import mx.collections.ArrayCollection;
			import mx.controls.Alert;
			import mx.rpc.events.FaultEvent;
			import mx.rpc.events.ResultEvent;
			import mx.utils.ArrayUtil;
			
			private function onLoad2(event:ResultEvent):void{
				
				var code:String = event.result as String;
				if(code=="Y"){
					
					png_id.source="png/qq在线.jpg";
				}else{
					png_id.source="png/qq离线.jpg";
				}
				
				
			}
			//错误处理程序
			private function faultHandler2(event:FaultEvent):void{
				Alert.show(event.fault.toString(),'WebService Error');
				
			}
			
			private function send():void{
				if(qq_id.text==""||qq_id.text==null){
					Alert.show('请输入qq号码');
				}else{
					qqwebService.qqCheckOnline(qq_id.text);
				}
				
			}
			
			protected function image1_mouseDownHandler(event:MouseEvent):void 
			{ 
				navigateToURL(new URLRequest("http://wpa.qq.com/msgrd?v=3&uin="+int(qq_id.text)+"&site=qq&menu=yes"),"_blank"); 
			}
		]]> 
	</fx:Script> 
	<mx:VBox  width="100%" height="100%"  >
	<!--	<local:WeatherView  width="100%" height="100%"/>-->
		<mx:TextInput id="qq_id" text=""/>
		<mx:Button id="btn_send" click="send()"  label="检测"/>
		<mx:Image source="png/qq离线.jpg"  id="png_id" toolTip="在线客服"  mouseDown="image1_mouseDownHandler(event)"/> 
	</mx:VBox>
</s:Application>


?

(编辑:李大同)

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

    推荐文章
      热点阅读