锘??xml version="1.0" encoding="utf-8" standalone="yes"?>日韩欧美中文免费,亚洲精品国精品久久99热,亚洲影视在线播放http://www.aygfsteel.com/yellowstonemay/category/40572.htmlzh-cnThu, 02 Jul 2009 20:36:48 GMTThu, 02 Jul 2009 20:36:48 GMT60use localConnection to comunicate between SWFhttp://www.aygfsteel.com/yellowstonemay/articles/285246.htmlyellowstoneyellowstoneThu, 02 Jul 2009 13:27:00 GMThttp://www.aygfsteel.com/yellowstonemay/articles/285246.htmlhttp://www.aygfsteel.com/yellowstonemay/comments/285246.htmlhttp://www.aygfsteel.com/yellowstonemay/articles/285246.html#Feedback0http://www.aygfsteel.com/yellowstonemay/comments/commentRss/285246.htmlhttp://www.aygfsteel.com/yellowstonemay/services/trackbacks/285246.html
Here is a simple example to demonstrate how it work base on Adobe training and my practice.

On Sender(client) side:
 <mx:Script>
  <![CDATA[
   import flash.net.LocalConnection;   //do the import
   private var conn:LocalConnection; 
   
   private function init():void{
    conn = new LocalConnection();  // create a new local connection instance
    conn.send("_mylocalconnection", "doCloseAgentPopup");  //send request to receiver(server) side. "_mylocalconnection" is kind of connection node. 
                                                                                            // "doCloseAgentPopup" is the function to call. you can also use some parameters followed it
   }
  ]]>
 </mx:Script>

On Receiver(server) side:
    import flash.net.LocalConnection;
    private  var conn:LocalConnection;
           
   private function initLocalConn():void
   {
    conn = new LocalConnection();
    conn.client = this;    // notice that this is called "client" here. I think it mean it is a client to provide service to other side.
    conn.connect("_mylocalconnection");    // connect to the node "_mylocalconnection" and wait call from other side
   }
   
   public function doCloseAgentPopup():void{        //this is the function to call from sender side. in this function, do general flex funtion as you like
    if(MyTitleWindow != null){
     PopUpManager.removePopUp(agentTitleWin);
     agentTitleWin = null;
     checkAgentStatus();
    }
   }

That is it. simple but work well. Enjoy it!



]]>
working with session on BlazeDShttp://www.aygfsteel.com/yellowstonemay/articles/284980.htmlyellowstoneyellowstoneWed, 01 Jul 2009 08:59:00 GMThttp://www.aygfsteel.com/yellowstonemay/articles/284980.htmlhttp://www.aygfsteel.com/yellowstonemay/comments/284980.htmlhttp://www.aygfsteel.com/yellowstonemay/articles/284980.html#Feedback0http://www.aygfsteel.com/yellowstonemay/comments/commentRss/284980.htmlhttp://www.aygfsteel.com/yellowstonemay/services/trackbacks/284980.htmlflex.messaging.HttpFlexSession" should be inserted.
It is how BlazeDS can work with session data.
BlazeDS provide several classes which is useful for get access to the session and the HTTP pieces of the session, such as the HTTP servlet request and response. This lets you access HTTP data when you use a Flex application in the context of a larger web application where other classes, such as JSPs or Struts actions, might have stored information.
  • flex.messaging.FlexContext
  • flex.messaging.FlexSession
  •  

    The following example shows a Java class that calls FlexContext.getHttpRequest() to get an HTTPServletRequest object and calls FlexContext.getFlexSession() to get a FlexSession object. By exposing this class as a remote object, you can make it accessible to a Flex client application; you place the compiled class in the WEB_INF/classes directory

    package myROPackage;
    import flex.messaging.*;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class SessionRO {
    public HttpServletRequest request;
    public FlexSession session;
    public UsefulRemoteObject() {
    request = FlexContext.getHttpRequest();
    session = FlexContext.getFlexSession();
    }
    public String getSessionId() throws Exception {
    String s = new String();
    s = (String) session.getId();
    return s;
    }
    public String getHeader(String h) throws Exception {
    String s = new String();
    s = (String) request.getHeader(h);
    return h + "=" + s;
    }
    }
    

    The following example shows a Remoting Service destination definition that exposes the SessionRO class as a remote object. You add this destination definition to your Remoting Service configuration file.

    ...
    <destination id="myRODestination">
    <properties>
    <source>myROPackage.SessionRO</source>
    </properties>
    </destination>
    ...
    

    The following examples shows an ActionScript snippet for calling the remote object from a Flex client application. You place this code inside a method declaration.

    ...
    ro = new RemoteObject();
    ro.destination = "myRODestination";
    ro.getSessionId.addEventListener("result", getSessionIdResultHandler);
    ro.getSessionId();
    ...
    


    ]]>
    主站蜘蛛池模板: 武山县| 茂名市| 桂东县| 东乡县| 库伦旗| 五指山市| 神木县| 将乐县| 六安市| 特克斯县| 淮南市| 庆元县| 东海县| 崇阳县| 南京市| 晋中市| 太保市| 三江| 麟游县| 屯昌县| 茌平县| 瓦房店市| 基隆市| 上杭县| 柯坪县| 丹寨县| 白城市| 富蕴县| 望江县| 南川市| 黑龙江省| 望谟县| 西盟| 西丰县| 雷州市| 罗甸县| 城固县| 玉树县| 哈密市| 班戈县| 西乡县|