Is there a way to call ActionScript on Android?
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");
Check this out http://code.google.com/p/java-actionscript-api-for-android/
With this framework, it is expected that any ActionScript coder could easily write Android app without the need of the Adobe Flash for Android.
For android, try using Adobe Flash Builder in CS5.5.
Import and play the swf and you can publish it for android there.
精彩评论