有没有一种方法来调用动作在Android?方法来、动作、Android

由网友(这场梦 我睡了好久才醒)分享简介:我在我的资产文件夹中的SWF文件,我需要在我的Andr​​oid应用程序中使用。所以我写的HTML文件,SWF嵌入式和Javascript调用它的动作。我可以在web视图播放Flash文件,但动作似乎并没有被调用,而JavaScript的工作。我试了一下我的笔记本电脑的网页浏览器,它不工作,直到我在闪光灯设置受信任的...

我在我的资产文件夹中的SWF文件,我需要在我的Andr​​oid应用程序中使用。 所以我写的HTML文件,SWF嵌入式和Javascript调用它的动作。我可以在web视图播放Flash文件,但动作似乎并没有被调用,而JavaScript的工作。

我试了一下我的笔记本电脑的网页浏览器,它不工作,直到我在闪光灯设置受信任的项目文件夹。

有没有在Android类似的设置?

下面是code我用的WebView。

 的WebView mWebView =(web视图)findViewById(R.id.webViewDisplay);

    mWebView.getSettings()setJavaScriptEnabled(真)。
    。mWebView.getSettings()setSaveFor​​mData(真正的);
    mWebView.getSettings()setPluginsEnabled(真)。
    。mWebView.getSettings()setAllowFileAccess(真正的);
    mWebView.setInitialScale(100);
    。mWebView.getSettings()setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
    mWebView.setWebViewClient(新MyWebViewClient());
    mWebView.setOnTouchListener(新View.OnTouchListener(){

        公共布尔onTouch(视图V,MotionEvent事件){
          返回(event.getAction()== MotionEvent.ACTION_MOVE);
        }
      });
    mWebView.loadUrl(文件:///android_asset/flash.html);
 

解决方案

检查了这一点的 HTTP://$c$c.google.com/p/java-actionscript-api-for-android/

Unity调用Android原生方法

通过这个框架,预计任何ActionScript codeR可以轻松地编写Android应用程序没有的的Adobe Flash为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.

阅读全文

相关推荐

最新文章