• purMVC代码备份


    package com.model
    {
    	import com.vo.Users;
    	
    	import mx.controls.Alert;
    	import mx.rpc.events.FaultEvent;
    	import mx.rpc.events.ResultEvent;
    	import mx.rpc.remoting.mxml.RemoteObject;
    	
    	import org.puremvc.as3.interfaces.IProxy;
    	import org.puremvc.as3.patterns.proxy.Proxy;
    	
    	
    	public class MyProxy  extends Proxy implements IProxy
    	{
    		
    		//重写父类的NAME变量
    		public static const NAME:String = "hello,Proxy!";
    		private var myService:RemoteObject;//RemoteObject传输 标签	
    		public function MyProxy(proxyName:String=null,data:Object=null)
    		{			
    			super(NAME,data);
    			
    			myService=new RemoteObject();
    			
    	        //myService.source="LoginService";
    	        
    			myService.endpoint="http://localhost:8081/remotingtest/messagebroker/amf";//服务请求路径    messagebroker  web.xml中的  配置   amf 固定写法
    			// endpoint: 此属性可使开发人员在编译或以编程方式创建 ChannelSet 时快速指定 RemoteObject 目标的端点,而无需引用服务配置文件。
    			
    			myService.destination="LoginFlex";	//java class 类的路径
    			
    			myService.addEventListener(FaultEvent.FAULT,doFault);//传输出错时调用
    			myService.addEventListener(ResultEvent.RESULT,getResult);//处理返回值
    
       
    				
    		}
    		public function get thisUser():Users//隐式getter  转化data类型  
    		{
    			return data as Users;
    		}
    
    
    
    
    
    
    		public  function login(vo:Users):void
    		{
    			
    			Alert.show("MyProxy方法传递的参数。。。"+vo.userName+"   "+vo.userPassword);
    			
    			myService.loginUser(vo);
    			
    			var userVo1:Users=myService.loginUser.lastResult as Users;
    			
    			Alert.show("MyProxy方法 返回值为。。。"+userVo1.userName+"==="+userVo1.userPassword);
    			
    			//发出消息	 消息标题 为  application的 字符 
    			//参数数据为  操作数据库去掉数据   用以前台UI显示
    		}
    		public function 
    
    	}
    }
    

      

  • 相关阅读:
    Redis数据库
    Nginx介绍
    shell脚本基础
    iptables防火墙
    Web自动化测试—Selenium文件操作
    Web自动化测试——Selenium之发送163邮件
    Web自动化测试—Selenium webdriver的基本操作
    Web自动化测试—webdriver的环境配置
    Web自动化测试—Selenium IDE的安装与使用
    Web自动化测试—什么是Selenium?
  • 原文地址:https://www.cnblogs.com/regalys168/p/3614695.html
Copyright © 2020-2023  润新知