On Wed, Oct 28, 2015 at 9:58 AM, Alex Harui <[email protected]> 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(key);
}


>
> On 10/28/15, 4:00 AM, "Manohar Jeyaraj" <[email protected]> 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 = "Simon";
> >obj.lastName = "Free";
> >webView.loadURL("javascript:myfunction('" + obj + "')");
> >
> >Below is the code of JS function in HTML page:
> >
> >function myfunction(obj)
> >{
> >        var str = obj.lastName;
> >        alert(str);
> > }
> >
> >The alert is showing up as 'undefined' in the application.
> >How to get the exact value of object in javascript? But if I write
> >alert(obj), it will display as [Object Object], which means there is
> >object
> >value there but i am not able to extract it. Kindly let me know if there
> >is
> >any way to extract object data in javascript.
>
>

Reply via email to