开发者

problem to load interactive swf in webview

开发者 https://www.devze.com 2023-03-19 19:46 出处:网络
i have develop one application in which i want to load SWF file in android.i have get success to load Non-interactive(linear) swf file. But i cant view User-Interactive(non-linear) file which basicall

i have develop one application in which i want to load SWF file in android.i have get success to load Non-interactive(linear) swf file. But i cant view User-Interactive(non-linear) file which basically des开发者_如何学Cign in action script 2.0 in flash. here i am attach my code can you give me solution?

package com.aaa;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class aaa extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    try{
    WebView wv=(WebView) findViewById(R.id.webView1);
    wv.getSettings().setJavaScriptEnabled(true);
    wv.getSettings().setPluginsEnabled(true);
    String html ="<object width=\"550\" height=\"400\"> " +
                 "<param name=\"movie\"  value=\"file:///android_asset/nxt.swf\"> " +
                 "<embed src=\"file:///android_asset/nxt.swf\"  width=\"550\" height=\"400\"> " +
                 "</embed> </object>";
    wv.setWebViewClient(new HelloWebViewClient());
    String mimeType = "text/html";
        String encoding = "utf-8";
    wv.loadDataWithBaseURL("null",html, mimeType, encoding, "");
    }catch (Exception e) 
    {
        e.printStackTrace();
    }
 }
}

Main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/white"
>
<WebView android:id="@+id/webView1" android:layout_width="match_parent"   android:layout_height="match_parent"></WebView>

</LinearLayout>


you can just try in AdobeAir-emulator if you are working with flash environment.check it out it is efficient to load any flash file.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号