setDimension($width, $height); $m->setRate(30); $spread = 40; //$s->setRightFill($s->addFill( rand(0,255), rand(0,255), rand(0,255) )); $s = new SWFShape(); $s->setLine(0, rand(0,255), rand(0,255), rand(0,255)); $prevx = $width/2+rand(-$spread,$spread); $prevy = $height/2+rand(-$spread,$spread); $prevcontrolx = $width/2+rand(-$spread,$spread); $prevcontroly = $height/2+rand(-$spread,$spread); $freq = array(); $amplitude = array(); $offset = array(); for($color = 0; $color < 3; $color++) { $freq[$color] = 2*pi()/rand(20,200); $amplitude[$color] = rand(200,255); $offset[$color] = rand(0,255-$amplitude[$color]); $phase[$color] = rand(0, 2*pi()*50)/50; } //$m->add($s); $r = array(); $outline = array(); for($counter = 0; $counter < 800; $counter++) { //$outline[$counter] = new SWFshape(); $r[$counter] = new SWFShape(); $red = $amplitude[1]*(1+sin($counter*$freq[1]+$phase[1]))/2+$offset[1]; $green = $amplitude[2]*(1+sin($counter*$freq[2]+$phase[2]))/2+$offset[2]; $blue = $amplitude[0]*(1+sin($counter*$freq[0]+$phase[0]))/2+$offset[0]; $r[$counter]->setLine(4, floor($red), floor($green), floor($blue)); $newx = $prevx + rand(-$spread,$spread); $newy = $prevy + rand(-$spread,$spread); $theta = atan2($prevy-$prevcontroly, $prevx-$prevcontrolx); $rad = rand($spread/2,$spread); $controlx = $rad*cos($theta)+$prevx; $controly = $rad*sin($theta)+$prevy; $r[$counter]->movePenTo($prevx, $prevy); $r[$counter]->drawCurveTo($controlx, $controly,$newx, $newy); /*$outline[$counter]->setLine(0, floor($red), floor($green), floor($blue)); $outline[$counter]->movePenTo($prevx, $prevy); $outline[$counter]->drawLineTo($newx, $newy);*/ $m->add($r[$counter]); //$m->add($outline[$counter]); $m->nextFrame(); $prevx = $newx; $prevy = $newy; $prevcontrolx = $controlx; $prevcontroly = $controly; if($newx < 0 || $newy < 0 || $newx > $width || $newy > $height) { $prevx = $width/2+rand(-$spread,$spread); $prevy = $height/2+rand(-$spread,$spread); $prevcontrolx = $width/2+rand(-$spread,$spread); $prevcontroly = $height/2+rand(-$spread,$spread); } } header('Content-type: application/x-shockwave-flash'); $m->output(); ?>