<?php
include "lib.php";
$time = time();
$date = getdate($time);
$year = $date[year];
$month = $date[mon];
$day = $date[mday];
$c1 =255;
$c2 =255;
$c3 =255;
$h = 400;
$w = 400;
$m = newmovie($h,$w,$c1,$c2,$c3);
$file = "fairy.jpg";
$img =addimg($file);
$dsimg =additem($m,$img,150,150);
$cc1 =255;
$cc2 =255;
$cc3 =0;
$si =180;
$c = circ($cc1,$cc2,$cc3,$si);
$lw =1;
$lc1h =0;
$lc2h =0;
$lc2h =0;
$p1h =0;
$p2h =-150;
$l =lin($lwh,$lc1h,$lc2h,$lc3h,$p1h,$p2h);
$sprite2 = sprite($l);
$name2 = 'sechand';
$sp1 =200;
$sp2 =200;
$ls =addsprite($m,$sprite2,$name2,$sp1,$sp2);
$ds =additem($m,$c,200,200);
$ds->multColor(0.0,0.0,0.0,0.1);
$fonttex = "AnkeCalligraph.ttf";
$font = dirname(__FILE__).'/' . $fonttex;
$fc1 =0;
$fc2 =0;
$fc2 =0;
$fstring ="12";
$fheight = 30;
$t =tex($font,$fc1,$fc2,$fc3,$fheight,$fstring);
$es =additem($m,$t,170,60);
$fstring1 ="6";
$t1 =tex($font,$fc1,$fc2,$fc3,$fheight,$fstring1);
$es1 =additem($m,$t1,185,360);
$fstring2 ="9";
$t2 =tex($font,$fc1,$fc2,$fc3,$fheight,$fstring2);
$es2 =additem($m,$t2,40,210);
$fstring3 ="3";
$t3 =tex($font,$fc1,$fc2,$fc3,$fheight,$fstring3);
$es3 =additem($m,$t3,350,200);
$fheight1 =10;
$fstring4 = 'Date ' . "$year" . " $month" . " $day";
$t4 =tex($font,$fc1,$fc2,$fc3,$fheight1,$fstring4);
$es4 =additem($m,$t4,50,370);
$lwh1 =2;
$lc1h1 =0;
$lc2h1 =0;
$lc2h1 =0;
$p1h1 =0;
$p2h1 =-130;
$l9 =lin($lwh1,$lc1h1,$lc2h1,$lc3h1,$p1h1,$p2h1);
$sprite1 = sprite($l9);
$name1 = 'bighand';
$sp1 =200;
$sp2 =200;
$ls9 =addsprite($m,$sprite1,$name1,$sp1,$sp2);
$lwh2 =2;
$lc1h2 =0;
$lc2h2 =0;
$lc2h2 =0;
$p1h2 =0;
$p2h2 =-70;
$l92 =lin($lwh2,$lc1h2,$lc2h2,$lc3h2,$p1h2,$p2h2);
$sprite = sprite($l92);
$name = "littlehand";
$sp1 =200;
$sp2 =200;
$ls92 =addsprite($m,$sprite,$name,$sp1,$sp2);
$m->add(new SWFAction("
now =new Date();
ho = now.getHours();
min = now.getMinutes();
sec = now.getSeconds();
bighand._rotation = min * 6;
sechand._rotation = sec * 6;
if (ho > 12) {
yy = ho + '.' + min;
littlehand._rotation = (yy-12) * 30; }
else {
yy = ho + '.' + min;
littlehand._rotation = yy * 30;
};
function movehand0() {
var th = sechand._rotation;
sechand._rotation = th +6; };
myInterval = setInterval(movehand0, 1000);
function movehand() {
var t = littlehand._rotation;
littlehand._rotation = t +30; };
myInterval1 = setInterval(movehand, 3600000);
function movehand1() {
var tb = bighand._rotation;
bighand._rotation = tb +6; };
myInterval2 = setInterval(movehand1, 60000);
"));
$m->save("clco.swf", 9);
$swf = "clco.swf";
showswf($swf,$h,$w);
?>
ok, so the bighand works the sec hand works the hour hand or littlehand movie clip does not, my function are
<?php
function newmovie($hn,$wn,$c1n,$c2n,$c3n) {
Ming_setScale(20.0000000);
ming_useswfversion(6);
$movie = new SWFMovie();
$movie->setRate(01.000000);
$movie->setDimension($hn, $wn);
$movie->setBackground($c1n,$c2n,$c3n);
return $movie; }
function newmovie4($hn,$wn,$c1n,$c2n,$c3n) {
Ming_setScale(20.0000000);
ming_useswfversion(4);
$movie = new SWFMovie();
$movie->setRate(20.000000);
$movie->setDimension($hn, $wn);
$movie->setBackground($c1n,$c2n,$c3n);
return $movie; }
function circ($c1,$c2,$c3,$size) {
$circleshape = new SWFShape();
$circleshape->setRightFill($c1,$c2,$c3);
$circleshape->drawCircle($size);
return $circleshape; }
function sq($lw,$lc1,$lc2,$lc3,$c1,$c2,$c3,$p1,$p2,$p3,$p4,$p5,$p6,$p7,$p8) {
$myShape =new SWFShape();
$myShape->setLine($lw,$lc1,$lc2,$lc3);
$myShape->setRightFill($c1,$c2,$c3);
$myShape->drawLine($p1,$p2);
$myShape->drawLine($p3,$p4);
$myShape->drawLine($p5,$p6);
$myShape->drawLine($p7,$p8);
return $myShape;
}
function acton($elem,$xf,$yf,$deg,$scalex,$scaley) {
$elem->move($xf,$yf);
$elem->rotate($deg);
$elem->scale($scalex,$scaley); }
function lin($lwh,$lc1h,$lc2h,$lc3h,$p1h,$p2h) {
$lin =new SWFShape();
$lin->setLine($lwh,$lc1h,$lc2h,$lc3h);
$lin->drawLine($p1h,$p2h);
return $lin; }
function addimg($file) {
$img = new SWFBitmap(fopen($file,"rb"));
return $img; }
function tex($font,$fc1,$fc2,$fc3,$fheight,$fstring) {
$Font=new SWFFont($font);
$Text=new SWFText();
$Text->setFont($Font);
$Text->setColor($fc1,$fc2,$fc3);
$Text->setHeight($fheight);
$Text->addString($fstring);
return $Text; }
function sprite($obj) {
$sprite= new SWFSprite();
$sprite->add($obj);
$sprite->nextFrame();
return $sprite; }
function nsound($soundfile) {
$f = $soundfile;
$file=fopen($f, "rb");
$sound=new SWFSound($file, SWF_SOUND_44KHZ|SWF_SOUND_16BITS|SWF_SOUND_STEREO);
return $sound; }
function but($button) {
$b = new SWFButton();
$b->addShape($button,SWFBUTTON_HIT|SWFBUTTON_UP|SWFBUTTON_DOWN|SWFBUTTON_OVER);
return $b;}
function addsound($b,$sound) {
$soundp = $b->addSound($sound, SWFBUTTON_MOUSEDOWN);
$soundp->loopinpoint(1*100);
$soundp->loopoutpoint(70 *1000);
$soundp->noMultiple();
return $soundp; }
function addsprite($movie,$sprite,$name,$sp1,$sp2) {
$f20 = $movie->add($sprite);
$f20->setName($name);
$f20->moveTo($sp1,$sp2);
return $f20; }
function showswf($swf,$swfh,$swfw) {
echo "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0' ID=objects WIDTH=$swfw HEIGHT=$swfh><PARAM NAME=movie VALUE='$swf'><EMBED src='$swf' WIDTH=$swfw HEIGHT=$swfh TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></OBJECT>"; }
function additem($movie,$obj,$pos1,$pos2) {
$shape=$movie->add($obj);
$shape->moveTo($pos1, $pos2);
return $shape; }
?>