setFont($f); $t->moveTo($width, $height-10); $t->setColor(0x00, 0x40, 0x80); $t->setHeight(32); $t->addString($text); // JPEGデータの読み込み。 $bmp1 = new SWFBitmap(fopen("banner.jpg", "rb")); $bmp1width = $bmp1->getwidth(); $bmp1height = $bmp1->getheight(); // Bitmapで矩形を塗りつぶしたShapeを用意 $s_bmp1 = new SWFShape(); $s_bmp1->setRightFill($s_bmp1->addFill($bmp1, SWFFILL_CLIPPED_BITMAP)); $s_bmp1->movePenTo(0,0); $s_bmp1->drawLine($bmp1width, 0); $s_bmp1->drawLine(0, $bmp1height); $s_bmp1->drawLine((-1)*($bmp1width), 0); $s_bmp1->drawLine(0, (-1)*($bmp1height)); // 先のShapeのスプライトを用意。Shapeの中心を原点に $sp1 = new SWFSprite(); $i_sp1 = $sp1->add($s_bmp1); $i_sp1->moveTo(-$bmp1width/2, -$bmp1height/2); $sp1->nextFrame(); // ぐるんぐるんのスプライトを用意 $sp_m = new SWFSprite(); $i_sm = $sp_m->add($sp1); $i_sm->moveTo(-$bmp1width/2, -$bmp1height/2); $i_sm->moveTo( $width/2, $height/2 ); // 文字のスプライトを用意 $tx_m = new SWFSprite(); $i_tm = $tx_m->add($t); $tx_m->nextFrame(); $textmovex = ($width + $t->getWidth($text)) / 128 ; // 1回転目はフツーにまわして for($i=0; $i<32; $i++){ $i_sm->rotateTo(-360.0/32*$i); $sp_m->nextFrame(); $i_tm->move(-$textmovex,0); $tx_m->nextFrame(); } //2回目はフェードイン・フェードアウトしたりとかする for($i=0; $i<32; $i++){ $i_sm->multColor(1, 1, 1, abs(16-$i)/16.0); $i_sm->rotateTo(-360.0/32*$i); $sp_m->nextFrame(); $i_tm->move(-$textmovex,0); $tx_m->nextFrame(); } // 3回転目は大きくなったり for($i=0; $i<16; $i++){ $i_sm->scaleTo(1.0+$i/16.0); $i_sm->rotateTo(-360.0/32*$i); $sp_m->nextFrame(); $i_tm->move(-$textmovex,0); $tx_m->nextFrame(); } // 小さくなったり for($i=16; $i<32; $i++){ $i_sm->scaleTo(2.0-(($i-16)*2)/16.0); $i_sm->rotateTo(-360.0/32*$i); $sp_m->nextFrame(); $i_tm->move(-$textmovex,0); $tx_m->nextFrame(); } // 4回転目で元の大きさへ for($i=1; $i<32; $i++){ $i_sm->scaleTo($i/32.0); $i_sm->rotateTo(-360.0/32*$i); $sp_m->nextFrame(); $i_tm->move(-$textmovex,0); $tx_m->nextFrame(); } // ムービー作りますよ $m = new SWFMovie(); $m->setDimension($width, $height); $m->setrate(16); $m->add($sp_m); $m->add($tx_m); // 保存しますよー $m->save("f0305301.swf"); ?>