Skip navigation
Currently Being Moderated

Unable to access variable from AIR

Apr 4, 2013 12:46 AM

Tags: #air #bridge #swf #remote #sandbox #application.application

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;

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points