I have a stageWebView in my flex Mobile app. I am trying to call a javascript function passing along some arguments.
protected function list1_changeHandler(event:IndexChangeEvent):void
{
var list:List = event.target as List;
var selectedString:String = list.selectedItem.label;
webView.loadURL("javascript:doIt("+selectedString+")");
}
Then I have my javascript code trying to use the selectedString I passed. It does not seem to be getting passed to the javascript. If I however pass a raw string like below it does work. Do I have quotes wrong or something else in the above code? Or can you not pass Objects from flexs?
protected function list1_changeHandler(event:IndexChangeEvent):void
{
var list:List = event.target as List;
var selectedString:String = list.selectedItem.label;
webView.loadURL("javascript:doIt('yeah')");
}
EDIT I had the quotes wrong.Should have been:
webView.loadURL("javascript:doIt('"+selectedString+"')");