Is there a way to call ActionScript on Android?
NickName:RobGThai Ask DateTime:2011-06-16T14:29:21

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");

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

Answers
Muhammad Shahab 2011-06-16T06:55:27

Check this out http://code.google.com/p/java-actionscript-api-for-android/\n\nWith this framework, it is expected that any ActionScript coder could easily write Android app without the need of the Adobe Flash for Android.",


More about “Is there a way to call ActionScript on Android?” related questions

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 ...

Show Detail

call from Javascript to ActionScript

Is there any way to call from javascript to actionscript, not using JSON object. thanks, Ravi

Show Detail

Actionscript 3: Controlling the physical back button in Android

I'm developing a simple app for Android using ActionScript 3.0 in Flash CS5 and I'd like to know if there's a way to map the physical back button of the Android's phone to tell my animation to go t...

Show Detail

Flex: How to call a actionscript source path from library project?

In flex created a SWC file. It has a Actionscript folder which contains the actionscript files. And then created a desktop project in which I want to invoke a actionscript file from SWC. In normal...

Show Detail

ActionScript socket in Android

I have a Flash client application, written in ActionScript, which uses the XMLSocket class to talk to the server device via TCP/IP, on port 5750. So for example, I can run the Flash client in a br...

Show Detail

Call an ActionScript function from Javascript

I want to call an Action Script function from javascript. But also I need the ActionScript function to return a value to the javascript call. This is what I want to accomplish. /* JS CODE */ v...

Show Detail

Can JavaScript call ActionScript code?

I'm new to Flash. I have created a flv player that can play videos dynamically based on a user selection in a list component. I would rather not develop the user interface in Flash. Meaning, I'd li...

Show Detail

Combine Actionscript/Flex Air Android Project with Java Android Project

Background: I have a Air Android project written in ActionScript using Flash Builder, and a Android Project in Java using Eclipse. I want to combine these two project, which I want to integrate the...

Show Detail

Flex Actionscript call parent function

I have an actionscript file in my flex project. I loaded the actionscript into flex via addElement() MXML File: <?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="ht.

Show Detail

Is function declaration allowed in function call for ActionScript?

I have the following code: var a= 1 + (function (x) { return x+1;} (2)); This is allowed in JavaScript, but in ActionScript, it's always show an error message, saying this line of code is wrong. I

Show Detail