// ReadyStateChange event
oleControlSite.addEventListener(DISPID_ONREADYSTATECHANGE,
new OleListener() {
public void handleEvent(OleEvent event) {
Variant state = event.arguments[0];
if (flashListener != null)
flashListener.onReadyStateChange(state.getInt());
}
});
// OnProgress event
oleControlSite.addEventListener(DISPID_ONPROGRESS, new OleListener() {
public void handleEvent(OleEvent event) {
Variant percentDone = event.arguments[0];
if (percentDone != null) {
if (flashListener != null)
flashListener.onProgress(percentDone.getInt());
}
}
});
// FSCommand event
oleControlSite.addEventListener(DISPID_FSCOMMAND, new OleListener() {
public void handleEvent(OleEvent event) {
Variant command = event.arguments[0];
Variant args = event.arguments[1];
if (command != null && args != null) {
if (flashListener != null)
flashListener.onFSCommand(command.getString(), args
.getString());
}
}
});
}