JFlashPlayer: how to generate ActionScript event

177 Views Asked by At

Using the DJNativeSwing JFlashPlayer, I need to intercept in Java a simple event generated by flash / actionscript.

Adding the Java listener seems obvious:

JFLashPlayer flashPlayer = new JFlashPlayer();
flashPlayer.addFlashPlayerListener(this);
(...)

@Override
public void commandReceived(FlashPlayerCommandEvent e) {
   System.out.println("Received flash command:"+e.getCommand());
}

But I couldn't find any documentation on how to generate a flash / actionscript event that would be catched by the listener.

Any idea / hint would be more than welcome ! Thx, Thomas

1

There are 1 best solutions below

0
On

this is the way how we say to flash to give us a chance to run something when some event happened and finished: (put this at the end of your event in your class)

edispatchEvent(new Event(Event.COMPLETE));

and this is how we use that point to run sth else where you have called and used the class:

class.addEventListener(Event.COMPLETE, your_Function);
your_Function(e:Event):void
{
    do my job
}