So I believe this is the original scenario
1. You have a Flex application on web page, index.html
2. You launch a new window from the Flex application using,
ExternalInterface.call("open", "testcase.html", "_blank");
Your question is:
Is it possible to execute Javascript from testcase.html that will call back to
the Flex application on the index.html page?
I think you can do it by leveraging window.opener in javascript
Testcase.html
<script>
function callBack(){
if(window.opener != null){
// backtoMyOriginalFunc is the name of a javascript
function in Index.html
window.opener.backToMyOriginalFunc()
}else{
alert("Unable to notify original window.");
}
}
</script>
Index.html
<script>
function backToMyOriginalFunc (){
// Find the flex application in the page
var flexApp = FABridge.flash.root();
// Call the function defined in the Flex application
flexApp.testCallBack();
}
</script>
Keegan Sands
Technical Lead
T: +1-603-570-4633
www.loftware.com
-----Original Message-----
From: pkumar.flex [mailto:[email protected]]
Sent: Thursday, August 27, 2015 2:05 PM
To: [email protected]
Subject: Re: Externalnterface
yes you can call a function from JavaScript to Flex. using
ExternalInterface.addCallback("JAVAScript Func", FlexFunction);
you only need to add this line on creationcomplate of any component.
On Thu, Aug 27, 2015 at 11:30 PM, mark goldin [via Apache Flex Users] <
[email protected]> wrote:
> I am opening a new browser window using the following command:
> ExternalInterface.call("open", "testcase.html", "_blank");
>
> Is it possible to call a function in Flex from testcase.html?
>
> Thanks
>
>
> ------------------------------
> If you reply to this email, your message will be added to the
> discussion
> below:
>
> http://apache-flex-users.2333346.n4.nabble.com/Externalnterface-tp1107
> 0.html To unsubscribe from Apache Flex Users, click here
> <http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.j
> tp?macro=unsubscribe_by_code&node=1&code=cHJhc2hha3VtYXJAZ21haWwuY29tf
> DF8LTU0MTcyMzE2NA==>
> .
> NAML
> <http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.j
> tp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabbl
> e.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamesp
> ace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscrib
> ers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_in
> stant_email%21nabble%3Aemail.naml>
>
--
*Regards,*
Prashant Kumar* | *Mob.: +91 8408811225
--
View this message in context:
http://apache-flex-users.2333346.n4.nabble.com/Externalnterface-tp11070p11071.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.