JFlashPlayer is a Flash Player API Java package that lets developers play and interact with Adobe Flash Player movies within Java applications. Advanced animations can improve the user experience and add to the professional appearance of an application. JFlashPlayer allows programmers to quickly add Flash movies to their Java application development for Windows.
With JFlashPlayer, the developer programmatically controls the Flash Player interface including the following functionality:
- call Java methods from Flash with ExternalInterface.call
- call Flash functions from Java with ExternalInterface.addCallback
- install Flash if it is not already present
- set Flash variables available at Movie startup
- play the Flash movie
- stop the Flash movie
- step back 1 frame in the movie
- step forward 1 frame in the movie
- rewind to beginning of the movie
- set loop (on or off)
- set background color
- legacy support for FSCommand and calling frame actions
Only a few lines of code are needed to add JFlashPlayer to your Java programs:
FlashPanel.setRequiredFlashVersion("9");
FlashPanel flashPanel = new FlashPanel(new File("Movie.swf"));
To call a Flash function from Java, the Java code would look like this:
String val = (String) flashPanel.callFlashFunction("sayHello", new Object[] { "A string argument" });
And the flash ActionScript code would look like this:
var methodName:String = "sayHello";
var method:Function = actualFunction;
ExternalInterface.addCallback(methodName, method);
function actualFunction(examplestring:String):String {
return "Hello from Flash";
}
To call Java methods from Flash, the Flash ActionScript code would look like this:
var response:String = ExternalInterface.call("sayHi", "hi");
And the Java code would have this method definition:
public String sayHi(String text) {
return "Aloha";
}
Full documentation and example code provide everything needed to integrate this Java API. JFlashPlayer has been rigorously tested and is being used by many Fortune 500 companies.
Operating System Support: Windows 98, Me, NT4, 2000, XP, and Vista
JRE Support: 1.4, 1.5, and 1.6