I am trying to use Tk::Animation but keep hitting this error. Can any monk provide insight on what i'm doing incorrectly? Thanks!
sub PlayAnimation{ my $animation_toplevel = $main::mw->Toplevel; my $img1 = $animation_toplevel->Photo(-file=>$Bin."/MMD/images/spinnin +gpenny.gif"); my $img = $animation_toplevel->Animation(-format => 'gif', -file =>$im +g1)->start_animation(10); my $anibut = $animation_toplevel->Button(-image=>$img, -command=>sub{p +rint"You pressed me!";})->pack; }
Error i'm getting
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/Owne +r/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 <ButtonRelease-1> (command bound to event)

In reply to HELP! Tk::Error using Tk::Animation by mikasue

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.