You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by "pkumar.flex" <pr...@gmail.com> on 2015/08/27 20:04:45 UTC

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] <
ml-node+s2333346n11070h55@n4.nabble.com> 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-tp11070.html
> To unsubscribe from Apache Flex Users, click here
> <http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=cHJhc2hha3VtYXJAZ21haWwuY29tfDF8LTU0MTcyMzE2NA==>
> .
> NAML
> <http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_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.

Re: Externalnterface

Posted by mark goldin <ma...@gmail.com>.
Seems like I cannot get the correct JS for my page that I am opening in the
new Browser window. Can someone share samples please?

On Sat, Sep 5, 2015 at 11:39 PM Alex Harui <ah...@adobe.com> wrote:

> JavaScript doesn’t have a concept of an ArrayCollection, but you can
> certainly encode an Array and pass it over to JS and have it become an
> Array over there.
>
> -Alex
>
> On 9/5/15, 6:22 AM, "mark goldin" <ma...@gmail.com> wrote:
>
> >Can I send an araycollection to javascript?
> >
> >On Thu, Aug 27, 2015 at 2:25 PM <KS...@loftware.com> wrote:
> >
> >> 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:prashakumar@gmail.com]
> >> Sent: Thursday, August 27, 2015 2:05 PM
> >> To: users@flex.apache.org
> >> 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] <
> >> ml-node+s2333346n11070h55@n4.nabble.com> 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-tp11070p1
> >>1071.html
> >> Sent from the Apache Flex Users mailing list archive at Nabble.com.
> >>
> >>
>
>

Re: Externalnterface

Posted by Alex Harui <ah...@adobe.com>.
JavaScript doesn’t have a concept of an ArrayCollection, but you can
certainly encode an Array and pass it over to JS and have it become an
Array over there.

-Alex

On 9/5/15, 6:22 AM, "mark goldin" <ma...@gmail.com> wrote:

>Can I send an araycollection to javascript?
>
>On Thu, Aug 27, 2015 at 2:25 PM <KS...@loftware.com> wrote:
>
>> 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:prashakumar@gmail.com]
>> Sent: Thursday, August 27, 2015 2:05 PM
>> To: users@flex.apache.org
>> 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] <
>> ml-node+s2333346n11070h55@n4.nabble.com> 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-tp11070p1
>>1071.html
>> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>>
>>


Re: Externalnterface

Posted by mark goldin <ma...@gmail.com>.
Can I send an araycollection to javascript?

On Thu, Aug 27, 2015 at 2:25 PM <KS...@loftware.com> wrote:

> 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:prashakumar@gmail.com]
> Sent: Thursday, August 27, 2015 2:05 PM
> To: users@flex.apache.org
> 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] <
> ml-node+s2333346n11070h55@n4.nabble.com> 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.
>
>

RE: Externalnterface

Posted by KS...@loftware.com.
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:prashakumar@gmail.com] 
Sent: Thursday, August 27, 2015 2:05 PM
To: users@flex.apache.org
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] <
ml-node+s2333346n11070h55@n4.nabble.com> 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.