The best way to learn how use it is to play with it. Here are some of the tricks I've discovered, but YMMV.

One of the big problems I've seen, is the difference in extensions which the mozilla flash plug-in recognizes, for you to open them locally. One is .swf and the other is .spl. So when you want to generate and play the flash files you create with Ming locally, try saving the output as .swf and .spl and try to open them with your browser and see which work. Remeber to take the "Context-type..." line out of the script if you are trying to create standalone files.

For instance if you want to make a japh.swf file, you would do something like:

my_mingscript > japh.swf #and then in your html put <html> <body> <center> <embed src="japh.swf" width="100%" height="100%" play="true"loop="true +" quality="high" scale="EXACTFIT"> </center> </body > </html>
Now if you want to output the cgi directly, you can do it
#!/usr/bin/perl use strict; use SWF qw(:ALL); SWF::setScale(1.0); print "Content-type: application/x-shockwave-flash\n\n"; my $s = new SWF::Shape(); my $b = new SWF::Bitmap('/home/soheil/src/ming-0.0.9/examples/common/b +ackyard.jpg'); my $f = $s->addFill($b); $s->setRightFill($f); $s->drawLine(640, 0); $s->drawLine(0, 480); $s->drawLine(-640, 0); $s->drawLine(0, -480); my $m = new SWF::Movie(); $m->setDimension(640, 480); $m->add($s); $m->output();

Finally, go to some flash websites that you like, and look at the html source to see how they embed their .swf file.


I'm not really a human, but I play one on earth. flash japh

In reply to Re: Flash animation by zentara
in thread Flash animation by Anonymous Monk

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.