sub PlayAnimation{ my $animation_toplevel = $main::mw->Toplevel; my $img1 = $animation_toplevel->Photo(-file=>$Bin."/MMD/images/spinningpenny.gif"); my $img = $animation_toplevel->Animation(-format => 'gif', -file =>$img1)->start_animation(10); my $anibut = $animation_toplevel->Button(-image=>$img, -command=>sub{print"You pressed me!";})->pack; } #### Tk::Error: Cannot open 'image3' in mode 'r' at C:/Perl/lib/Tk/Image.pm line 21. Tk callback for .toplevel1 Tk callback for image Tk::Image::new at C:/Perl/lib/Tk/Image.pm line 21 Tk::Animation::new at C:/Perl/lib/Tk/Animation.pm line 26 Tk::Widget::__ANON__ at C:/Perl/lib/Tk/Widget.pm line 256 MMD::PROGRAMDEFAULTS::PlayAnimation at C:/Documents and Settings/Owner/My Docum ents/pianokeys/MMD/PROGRAMDEFAULTS.pm line 105 main::__ANON__ at pianokeysprogram.pl line 74 Tk callback for .toplevel.canvas.button Tk::__ANON__ at C:/Perl/lib/Tk.pm line 252 Tk::Button::butUp at C:/Perl/lib/Tk/Button.pm line 111 (command bound to event)