Sunday, September 28, 2014

How to Embed Java in Flash

Instructions

    1

    Download and install the Java Flash Player API from jpackages.com. You can get the trial version for free or purchase the API.

    2

    Add the downloaded JAR file to your classpath. In the Eclipse project window, click Java Build Path, and then the Add External Jars tab in the right panel. Navigate to the Java Flash Player JAR and click "OK."

    3

    Use the Java Flash Player API to import a Flash file into your project:

    import java.awt.;
    import java.awt.event.
    ;
    import javax.swing.;
    import javax.swing.filechooser.FileFilter;
    import java.io.
    ;
    import com.jpackages.jflashplayer.*;

    class FlashTest

    public static void main(String[] args)

    FlashPanel.setRequiredFlashVersion("9");
    FlashPanel flashPanel = new FlashPanel(new File("Movie.swf")); // loaded movie



No comments:

Post a Comment