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
|