actionscript 3 - Flex Mobile webView.loadURL() not working -


i have stagewebview in flex mobile app. trying call javascript function passing along arguments.

protected function list1_changehandler(event:indexchangeevent):void             {                 var list:list = event.target list;                 var selectedstring:string = list.selecteditem.label;                 webview.loadurl("javascript:doit("+selectedstring+")");             } 

then have javascript code trying use selectedstring passed. not seem getting passed javascript. if pass raw string below work. have quotes wrong or else in above code? or can not pass objects flexs?

protected function list1_changehandler(event:indexchangeevent):void             {                 var list:list = event.target list;                 var selectedstring:string = list.selecteditem.label;                 webview.loadurl("javascript:doit('yeah')");             } 

edit had quotes wrong.should have been:

webview.loadurl("javascript:doit('"+selectedstring+"')"); 

try

protected function list1_changehandler(event:indexchangeevent):void         {             var list:list = event.target list;             var selectedstring:string = list.selecteditem;             var url:string = "javascript:doit('" + selectedstring + "')";             webview.loadurl(url);         } 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -