setRate(31); $movie->setDimension(550,400); $movie->setBackground(0xCC,0xCC,0xCC); $filesrc1="cnew2.mp3"; $filecontents1=file_get_contents($filesrc1); $mp3len=$movie->streamMp3($filecontents1); $width=550; $height=400; $gradient=new SWFGradient(); $gradient->addEntry(0.2,0,0,0); $gradient->addEntry(0.5,200,25,25); $gradient->addEntry(0.8,0,0,0,0); $gradient2=new SWFGradient(); $gradient2->addEntry(0.2,215,215,250,0); $gradient2->addEntry(0.5,25,25,25); $gradient2->addEntry(0.8,25,25,200); $morph = new SWFMorph(); $sh1 = $morph->getShape1(); $fill=$sh1->addFill($gradient, SWFFILL_LINEAR_GRADIENT); $fill->scaleTo(0.5); $fill->moveTo(100,100); $fill->rotateTo(-90); $sh1->setLeftFill($fill); $sh1->drawLine($width,0); $sh1->drawLine(0,$height); $sh1->drawLine(-$width,0); $sh1->drawLine(0,-$height); $sh2=new SWFShape(); $sh2 = $morph->getShape2(); $fill=$sh2->addFill($gradient2, SWFFILL_LINEAR_GRADIENT); $fill->scaleTo(0.5); $fill->moveTo(100,100); $fill->rotateTo(-90); $sh2->setLeftFill($fill); $sh2->drawLine($width,0); $sh2->drawLine(0,$height); $sh2->drawLine(-$width,0); $sh2->drawLine(0,-$height); $f1 = $movie->add($morph); for($i=0; $i<($mp3len/2); $i++) { $f1->setRatio($i/($mp3len/2)); $movie->nextFrame(); } for($i=($mp3len/2); $i>=0; $i--) { $f1->setRatio($i/($mp3len/2)); $movie->nextFrame(); } // save swf with same name as filename $swfname = basename(__FILE__,".php"); $movie->save("$swfname.swf",9); ?>