#!/usr/bin/perl use warnings; use strict; use SWF::Builder; my $m = SWF::Builder->new( FrameRate => 15, FrameSize => [ 0, 0, 400, 400 ], BackgroundColor => '000000' ); my $mcr = $m->new_movie_clip; my $mcg = $m->new_movie_clip; my $mcb = $m->new_movie_clip; #a 32 kbit/s, 22050 Hz mono mp3 with some lead silence added # mine is computer generated sound made with "flite". my $sound = $m->new_sound( '1japh5c.mp3' ); $sound->play(Frame=>80); #need actual font location, or copy one to the script directory my $font = $m->new_font( "Generic.ttf" ); # You may need to change it. my $message = 'Just Another Perl Hacker ....... '; my $textr = $mcr->new_static_text->font( $font )->size( 30 )->color( 'ff0000' ) ->text($message); my ( $xr1, $yr1, $xr2, $yr2 ) = $textr->get_bbox; my $tir = $textr->place->moveto( -( $xr1 + $xr2 ) / 2, -( $yr1 + $yr2 ) / 2 ); $xr1 -= 10; $yr1 -= 10; $xr2 += 10; $yr2 += 10; my $textg = $mcg->new_static_text->font( $font )->size( 30 )->color( '00ff00' ) ->text($message); my ( $xg1, $yg1, $xg2, $yg2 ) = $textg->get_bbox; my $tig = $textg->place->moveto( -( $xg1 + $xg2 ) / 2, -( $yg1 + $yg2 ) / 2 ); $xg1 -= 10; $yg1 -= 10; $xg2 += 10; $yg2 += 10; my $textb = $mcb->new_static_text->font( $font )->size( 30 )->color( '0000ff' ) ->text($message); my ( $xb1, $yb1, $xb2, $yb2 ) = $textb->get_bbox; my $tib = $textb->place->moveto( -( $xb1 + $xb2 ) / 2, -( $yb1 + $yb2 ) / 2 ); $xb1 -= 10; $yb1 -= 10; $xb2 += 10; $yb2 += 10; my $mcrp = $mcr->place; $mcrp->moveto( 200, 200 ); $mcrp->scale( 1, 1 ); my $mcgp = $mcg->place; $mcgp->moveto( 200, 200 ); $mcgp->scale( 1, 1 ); my $mcbp = $mcb->place; $mcbp->moveto( 200, 200 ); $mcbp->scale( 1, 1 ); my $scale = .5; for (my $x = 0; $x < 24; $x++) { $mcrp->rotate(-30); $mcgp->rotate(15); $mcbp->rotate(-15); $mcrp->scale($scale); $mcgp->scale($scale); $mcbp->scale($scale); $scale += .05; } for (my $x = 0; $x < 24; $x++) { $mcrp->scale(1,1); $mcgp->scale(1,1); $mcbp->scale(1,1); } for (my $x = 0; $x < 20; $x++) { $mcgp->scale(1.1); } for (my $x = 0; $x < 36; $x++) { $mcgp->scale(1); } $m->save( "$0.swf" );