Quantcast
Channel: Adobe Community : Popular Discussions - Archived Discussions
Viewing all articles
Browse latest Browse all 21156

calling a function in child window from parent window

$
0
0

Hi,

 

How can I call a method in child window from parent window in adobe air using javascript. In the following example I need to call mytest() function in

child.html from parent.html file.

 

Thanks,

ASM

 


//parent.html

<HTML><HEAD>
<script>
var initOptions = new air.NativeWindowInitOptions();
initOptions.type = air.NativeWindowType.NORMAL;
initOptions.systemChrome = air.NativeWindowSystemChrome.STANDARD;
var bounds = new air.Rectangle(300, 300, 600, 500);
var html2 = air.HTMLLoader.createRootWindow(false, initOptions, false, bounds);
var urlReq2 = new air.URLRequest("child.html");
html2.load(urlReq2);
html2.stage.nativeWindow.activate();

 

html2.window.mytest();       //NOT WORKING

 

</script>
</HEAD><body></body></HTML> 



// child.html

<HTML><HEAD>

<script>

function mytest()
{
  air.trace("in child window");
}

</script>

</HEAD> <body></body></HTML>


Viewing all articles
Browse latest Browse all 21156

Trending Articles



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