I have a SWF file in my assets folder that I need to use in my Android application.
So I write html file with SWF embedded and Javascript to call its ActionScript. I can play Flash file in WebView but the ActionScript doesn't seem to get called, but the JavaScript work.
I tried it on my laptop web browser and it doesnt work until I trusted the project folder in Flash setting.
Is there a similar setting on Android?
Here is the code I used for WebView.
WebView mWebView=(WebView)findViewById(R.id.webViewDisplay);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setSaveFormData(true);
mWebView.getSettings().setPluginsEnabled(true);
mWebView.getSettings().setAllowFileAccess(true);
mWebView.setInitialScale(100);
mWebView.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
mWebView.setWebViewClient(new MyWebViewClient());
mWebView.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
return (event.getAction() == MotionEvent.ACTION_MOVE);
}
});
mWebView.loadUrl("file:///android_asset/flash.html");
Copyright Notice:Content Author:「RobGThai」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/6367939/is-there-a-way-to-call-actionscript-on-android