0 Replies Latest reply: Apr 4, 2013 12:46 AM by r4raghs RSS

    Unable to access variable from AIR

    r4raghs Community Member

      How to access air application variable in sub-application(placed in remote server) loaded using SWFLoader?

      Main.mxml

      <?xml version="1.0"?>

      <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml">

           <mx:Script>

              <![CDATA[

       

                          public var str:String = "string for testing";

       

              ]]>

          </mx:Script>

       

           <mx:SWFLoader source="http://localhost/workspace/Sub.swf"/>

      </mx:WindowedApplication>

       

      Sub.mxml

      <?xml version="1.0"?>

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()">

                <mx:Script>

                          <![CDATA[

                          import mx.core.Application;

                          import mx.controls.Alert;

                          protected function init():void

                          {

             Alert.show(Application.application.str);

                          }

                          ]]>

                </mx:Script>

      </mx:Application>

       

      Got this error : Property str not found on Sub and there is no default value. Application.application global variable not working for AIR - Remote SWF combination. any other option except Sandbox bridge? In addition I can access sub application properties using Object(swf.content).application.someProperty;