JFlashPlayer Documentation

Examples

The following is a demonstration of how to create a program with JFlashPlayer

Example1.java

This example demonstrates much of the JFlashPlayer functionality including playing movies, stopping, changing frames, and listening to fscommand events. To run the example, double click the included runExample1.bat file. Classes and source code are included in the example directory. Below are some excerpts from the source code.

Implement FlashPanelListener to catch FSCommand events

public class Example1 extends JFrame implements FlashPanelListener {  

  public void FSCommand(String command, String arg) {
    System.out.println("java FSCommand " + command + " " + arg);    
  }

Create a FlashPanel to display a Flash movie

flashPanel = new FlashPanel(new File("Movie.swf"));
this.getContentPane().add(flashPanel, BorderLayout.CENTER);