5 Replies Latest reply on May 7, 2009 10:19 AM by hkpadobe

    Communication between Applications

    hkpadobe

      I was wondering would it be possible to communicate (reference Vairables, Method, Functions etc..) between Applications. What I want to do is have my 1st Application return some variables which the 2nd Application will use to construct a Bubble Chart. If this is possible what is the code to reference between the Applications?

       

      Thanks.

        • 1. Re: Communication between Applications
          Gregory Lafrance Level 6
          1 person found this helpful
          • 2. Re: Communication between Applications
            hkpadobe Level 1

            Thanks, Greg. I'll take a look.

            • 3. Re: Communication between Applications
              hkpadobe Level 1

              Greg, from the info reviewed I should be able to solve my query.

               

              Thanks

              • 4. Re: Communication between Applications (.swf files)
                hkpadobe Level 1

                I made an attempt to try and communicate between 2 .swf files using the LocalConnection, but am not able to get it working. To recap what I was trying to do was:

                 

                1st Application (.swf file) this application after a series of questions are answered I have functions that will calculate the values that will provide the data for the Bubble Chart, my 2nd Application (.swf file).

                 

                Below are my functions that calculate the data for the ArrayCollection to the Bubble Chart. So Curr_Evaluation is what needs to be sent to the 2nd Application.

                 

                public trace("NC is: " +Curr_Evaluation.getItemAt(0).NetworkChance); } public function setCurrEvalNI():void { Curr_Evaluation.getItemAt(0).NetworkInvestment = finalNetInvest.toFixed(2); trace("NI is: " +Curr_Evaluation.getItemAt(0).NetworkInvestment); } public function setCurrEvalNP():void { Curr_Evaluation.getItemAt(0).NetworkPotential = finalNetPot.toFixed(2); trace("NP is: " +Curr_Evaluation.getItemAt(0).NetworkPotential); } function setCurrEvalNC():void { Curr_Evaluation.getItemAt(0).NetworkChance = finalNetChance.toFixed(2);

                 

                I have a Submit Button on the 1st Application that when clicked I want the data to be sent to the 2nd Application. I have already got a function that handles the click for another purpose as shown below.

                 

                private "Complete with this Process?", "Please confirm:", Alert.YES | Alert.NO, this, submitHandler); } private function submitHandler(evt:CloseEvent):void { if (evt.detail == Alert.YES) { setCurrEvalNP(); setCurrEvalNC(); setCurrEvalNI(); ExternalInterface.call( "SubmitPresentation", "True"); } } function onBtnSubmit(evt:Event): void { Alert.show(

                On the 2nd Application my code is as shown below

                 


                If anyone can help with putting together with the code that I would need on my 1st and 2nd Application to make the communication between them, it would be appreciated.

                 

                Thanks

                • 5. Re: Communication between Applications (.swf files)
                  hkpadobe Level 1

                  The code on my 2nd Application.

                   

                  public
                  
                  
                  return(peData);
                  }
                  
                  
                  
                  public function getDataForCE(appCE:ArrayCollection):ArrayCollection {
                  ceData = appCE;
                  
                  
                  
                  return(ceData);
                  }
                  
                  ]]>
                  
                  
                  </mx:Script>
                  
                  
                  
                  <!-- <KAM_comp:KAM_Header label="Kam BubbleChart" id="KamBC"/> -->
                  
                  
                  <!-- Define custom color and line style for the bubbles. -->
                  
                  <mx:SolidColor id="sc1" color="blue" alpha="0.70"/>
                  
                  <mx:Stroke id="stroke1" color="blue" weight="2"/>
                  
                  <mx:SolidColor id="sc2" color="blue"/>
                  
                  <mx:Stroke id="stroke2" color="blue" weight="1"/>
                  
                  
                  <mx:Panel title="KAM Network Evaluation" x="36" y="32" height="90%" width="90%" horizontalAlign="left">
                  
                  <mx:BubbleChart id="KAMChart"height="
                  
                  100%" width="100%"paddingRight="
                  
                  5" paddingLeft="5" showDataTips="
                  
                  true">
                  
                  
                  <mx:series>
                  
                  <mx:BubbleSeries
                  dataProvider="
                  {getDataForPE(appPE)}"displayName="
                  
                  Previous Evaluation" xField="
                  
                  NetworkChance" yField="
                  
                  NetworkInvestment" radiusField="
                  
                  NetworkPotential"fill="
                  
                  {sc1}"stroke="
                  
                  {stroke1}"
                  
                  />
                  
                  
                  <mx:BubbleSeries
                  dataProvider="
                  {getDataForCE(appCE)}"displayName="
                  
                  Current Evaluation" xField="
                  
                  NetworkChance" yField="
                  
                  NetworkInvestment" radiusField="
                  
                  NetworkPotential"fill="
                  
                  {sc2}"stroke="
                  
                  {stroke2}"
                  
                  
                  />
                  
                  
                  </mx:series> 
                  
                  </mx:BubbleChart> 
                  
                  <mx:Legend dataProvider="{KAMChart}"/> 
                  
                  </mx:Panel>
                  
                  
                  
                   function getDataForPE(appPE:ArrayCollection):ArrayCollection {
                  peData = appPE;