Re: help please! - Rotation

gaz b <[email protected]> Wed, 5 Nov 2003 06:43:51 -0800 (PST)
Newsgroups gmane.comp.web.ming.general
Message-ID <[email protected]>
Below is an example of using rotateTo(), 
the swf is at my site.
gazb
..................................
<?
// some typical movie variables
Ming_setScale(20.00000000);
ming_useswfversion(6);
$movie=new SWFMovie();
$movie->setDimension(550,400);
$movie->setBackground(0xcc,0xcc,0xcc);
$movie->setRate(12); 

$squareshape=new SWFShape(); 
$squareshape->setRightFill(255,0,0); 
$squareshape->movePenTo(-50,-50);
$squareshape->drawLine(100,0);  
$squareshape->drawLine(0,100); 
$squareshape->drawLine(-100,0); 
$squareshape->drawLine(0,-100); 

// add the square to a sprite
$sprite1 = new SWFSprite();
$clip1=$sprite1->add($squareshape);
$sprite1->nextFrame();

// add the above sprite to another sprite 
$sprite2 = new SWFSprite();
$clip2=$sprite2->add($sprite1);

// now rotate clip2 inside sprite2
$rotateSpeed=5;
for($i=$rotateSpeed;$i<91;$i+=$rotateSpeed){
	$clip2->rotateTo($i);
	$sprite2->nextFrame();
}
// add one to movie
$rotatingSquareClip=$movie->add($sprite2);
$rotatingSquareClip->moveTo(200,200);

$movie->save("rotateto.swf");
?>
..........................................


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree