Quantcast
Channel: Adobe Community : Unanswered Discussions - AIR Development
Viewing all articles
Browse latest Browse all 2010

childSandboxBridge not working

$
0
0

i cut and pasted the examples given in the AIR documentation and get "TypeError: Result of expression 'childInterface' [undefined] is not an object".  AIR 3.9, OS X 10.9.1.  any ideas?  thanks.

 

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

child.html:

 

<html>

 

<head>

    <title>child</title>

    <script type="text/javascript">

        var interface = {};

        interface.calculatePrice = function(){

            return ".45 cents";

        }

        interface.storeID = "abc"

        window.childSandboxBridge = interface;

    </script>

</head>

 

<body>

    <h1>child</h1>

</body>

</html>

 

 

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

helloworld.html:

 

<html>

 

<head>

    <title>Hello World</title>

    <script type="text/javascript" src="AIRAliases.js"></script>

    <script type="text/javascript">

        function appLoad(){

            air.trace("Hello World");

        }

    </script>

</head>

 

<body onLoad="appLoad()">

    <iframe id='child' src='child.html'></iframe>

    <h1>Hello World</h1>

    <script>

    var childInterface = document.getElementById("child").contentWindow.childSandboxBridge;

    air.trace(childInterface.calculatePrice()); //traces ".45 cents"

    air.trace(childInterface.storeID); //traces "abc"

    </script>

</body>

 

</html>


Viewing all articles
Browse latest Browse all 2010

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>