Not able to pass Object from stagewebview to javascript function

2015-10-28 Thread Manohar Jeyaraj
Hi, My requirement is to pass object from stagewebview to javascript function in HTML page. Below is the sample code in Flex: var obj:Object = new Object(); obj.firstName = "Simon"; obj.lastName = "Free"; webView.loadURL("javascript:myfunction('" + obj + "')"); Below is the code of JS function

Re: Not able to pass Object from stagewebview to javascript function

2015-10-28 Thread Alex Harui
Did you try using JSON on both sides to stringify and parse obj? On 10/28/15, 4:00 AM, "Manohar Jeyaraj" wrote: >Hi, > >My requirement is to pass object from stagewebview to javascript function >in HTML page. > >Below is the sample code in Flex: > >var obj:Object = new Object(); >obj.firstName =

Re: Not able to pass Object from stagewebview to javascript function

2015-10-28 Thread OmPrakash Muppirala
On Wed, Oct 28, 2015 at 9:58 AM, Alex Harui wrote: > Did you try using JSON on both sides to stringify and parse obj? > I don't think it is required to stringify an object before passing flash to JS. In javascript, try to enumerate the passed object like this: for (var key in obj) { alert(

Re: Not able to pass Object from stagewebview to javascript function

2015-10-28 Thread Alex Harui
On 10/28/15, 11:26 AM, "omup...@gmail.com on behalf of OmPrakash Muppirala" wrote: >On Wed, Oct 28, 2015 at 9:58 AM, Alex Harui wrote: > >> Did you try using JSON on both sides to stringify and parse obj? >> > >I don't think it is required to stringify an object before passing flash >to >JS.

Re: Not able to pass Object from stagewebview to javascript function

2015-11-09 Thread Manohar Jeyaraj
ExternalInterface is not available as I am using this in mobile application. Hence I am using stagewebview. I am using stagewebview(to display HTML Google map) to call a javascript function in flex mobile application. I am passing a selected item value(from flex) to a javascript function like bel

Re: Not able to pass Object from stagewebview to javascript function

2015-11-09 Thread Alex Harui
Is your JS function being called, but just not with the right value? If so, I would just JSON to stringify the object. -Alex On 11/9/15, 3:42 AM, "Manohar Jeyaraj" wrote: >ExternalInterface is not available as I am using this in mobile >application. Hence I am using stagewebview. > >I am using

Re: Not able to pass Object from stagewebview to javascript function

2015-11-09 Thread jude
Manohar, Try this stagewebview wrapper, https://github.com/monkeypunch3/flexcapacitor/blob/master/MainMobileLibrary/src/com/flexcapacitor/controls/WebView.as. You would pass objects as stringified JSON as Alex mentioned. FYI In the latest Android a user reported you must add a fake protocol to get

Re: Not able to pass Object from stagewebview to javascript function

2015-11-10 Thread Manohar Jeyaraj
the required function is working only when i > add > > >it > > >under onload in body as below: > > > > > > > > > > > >but when i remove the onload method from the body of html and call it > from > > >flex the required action is not happe

Re: Not able to pass Object from stagewebview to javascript function

2015-11-10 Thread Alex Harui
I saw you commented out an alert of the “str” passed in. What does it look like when it works and when it doesn’t work? On 11/10/15, 3:06 AM, "Manohar Jeyaraj" wrote: >Hi, > >Thanks Alex and Jude for the prompt reply. I tried with stagewebview >wrapper it is working fine in simulator but not in

Re: Not able to pass Object from stagewebview to javascript function

2015-11-10 Thread manu
indly help me out on what is causing the issue? > >> > > >> > > >> > >> > >> -- > >> If you reply to this email, your message will be added to the > discussion > >> below: > >> > >> >

Re: Not able to pass Object from stagewebview to javascript function

2015-11-10 Thread Alex Harui
If the alert is exactly the same, it could mean that there is some other difference going on after this function gets called. You might try one final check using alert which is to display the typeof(str) to make sure it is a string in both cases. If it is, I think you will have to start debugging