0

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");
RobGThai
  • 5,937
  • 8
  • 41
  • 59

2 Answers2

1

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.

Muhammad Shahab
  • 4,187
  • 4
  • 34
  • 44
  • This mean recreating Flash inside Android, correct? Look interesting. However I know nothing about Flash ActionScript and the SWF file is actually from other people instead. – RobGThai Jun 16 '11 at 08:03
0

For android, try using Adobe Flash Builder in CS5.5.
Import and play the swf and you can publish it for android there.

Raj A.N.T. Gounder
  • 490
  • 1
  • 6
  • 17