How to communicate between two application mxml?

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default How to communicate between two application mxml?

    I want to communicate another application mxml.How can do it?
    eg,
    A.mxml

    --------------------------------------------------------------------------------
    --------------------------------------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
    <mx:Label text="User Name"></mx:Label><mx:TextInput id="userName"
    ></mx:TextInput>
    <mx:Button label="jump to another allication mxml"></mx:Button>
    </mx:Application>

    --------------------------------------------------------------------------------
    --------------------------------------
    B.mxml

    --------------------------------------------------------------------------------
    --------------------------------------

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
    <mx:Label text="User Name(input by A.mxml)"></mx:Label><mx:TextInput
    id="userName" ></mx:TextInput>
    </mx:Application>

    two mxml can send the simple String value.
    who can help me to solve this problem?
    help! thanks very much!

    qikeyang81 Guest

  2. Similar Questions and Discussions

    1. Displaying a jsp file using mxml application
      Hi, i need to display a jsp, file when a click event is fired in mxml application. i know it can be done using getURL("abc.jsp"); other than...
    2. mxml application finishings
      Hi, Our applicaiton is completed. Thanks a lot for our team to help us in a lot of situations. It is time to deploy our first phase. We have...
    3. Passing values from one mxml application to anotherapplication in Flex 1.5.
      Hi i want to know about passing variables from one mxml file to another mxml file in Flex 1.5. both will be different application or i want...
    4. How to use a Sprite or a MoveClip as content of aPanel/Container in MXML application
      I've been writing a MXML application, where i want to control some animation. A animation is being acheived thru creating a custom MovieClip using...
    5. Communicate between activex DLL and exe application?
      How is this possible? I need to send a message from my DLL (from ASP) to an exe app that i've written. Thanks --- Outgoing mail is...
  3. #2

    Default Re: How to communicate between two application mxml?

    See flash.net.LocalConnection clas, i allows you to make calls between flex applications given that they are running in the same computer.

    Regards
    prdv Guest

  4. #3

    Default Re: How to communicate between two application mxml?

    thanks prdv
    qikeyang81 Guest

  5. #4

    Default Re: How to communicate between two application mxml?

    You did not say how the two applications were going to be run.

    If each app is running in a separate browser, then prdv's solution is correct.
    If this is not what is going to happen, then post back with more details.

    I have a LocalConnection example in Flex 1.5, but have not migrated it to 2.0
    yet.

    Tracy

    ntsiii Guest

  6. #5

    Default Re: How to communicate between two application mxml?

    Hi ntsiii ,can you give me the sample,Thanks very much!
    qikeyang81 Guest

  7. #6

    Default Re: How to communicate between two application mxml?

    Sure.
    Tracy


    --LocalConnectionReceive.mxml--
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
    initialize="initialize()">
    <mx:Script>
    var myConnection;
    function initialize() {
    myConnection = new LocalConnection();
    myConnection.messagePosted = mx.utils.Delegate.create(this,
    messagePosted);
    myConnection.connect("receivingapp");
    }
    function messagePosted(message) {
    messageList.text = message;
    }
    </mx:Script>
    <mx:TextArea id="messageList" width="300" height="300"/>
    </mx:Application>

    --LocalConnectionSend.mxml--
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
    initialize="initialize()" creationComplete="sendMessage(event)"
    mouseDown="sendMessage(event)">
    <mx:Script>
    var myConnection;
    function initialize() {
    myConnection = new LocalConnection();
    }
    function sendMessage(event) {
    myConnection.send("receivingapp", "messagePosted",
    event.target.text);
    }
    </mx:Script>
    <mx:TextArea id="tiSend" change="sendMessage(event)" width="300"
    height="300"/>
    </mx:Application>

    ntsiii Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139