Whole SWF preview

This commit is contained in:
Jindra Petk
2013-09-01 15:03:57 +02:00
parent c1fc8d28fb
commit e087342e72
3 changed files with 103 additions and 10 deletions

View File

@@ -153,6 +153,9 @@ public class ImagePanel extends JPanel implements ActionListener, FlashDisplay {
}
private void drawFrame() {
if(drawable == null){
return;
}
int nframe = percent * drawable.getNumFrames() / 100;
if (nframe != frame) {
ImageIcon icon = new ImageIcon(drawable.toImage(nframe, swf.tags, swf.displayRect, characters, new Stack<Integer>()));
@@ -197,7 +200,11 @@ public class ImagePanel extends JPanel implements ActionListener, FlashDisplay {
@Override
public void gotoFrame(int frame) {
percent = frame * 100 / drawable.getNumFrames();
if(drawable==null){
percent = 0;
}else{
percent = frame * 100 / drawable.getNumFrames();
}
drawFrame();
}