flash on 2011-10-29
/**
* Copyright zahir ( http://wonderfl.net/user/zahir )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/fOiY
*/
package {
import flash.display.Shape;
import flash.display.Sprite;
public class FlashTest extends Sprite {
private var container:Sprite;
public function FlashTest() {
// write as3 code here..
container = addChild( new Sprite() ) as Sprite ;
var size:int = 50;
var c1:Circle = new Circle( size );
container.addChild( c1 );
c1.rotationX = -25;
c1.rotationY = -22;
var c2:Circle = container.addChild( new Circle(size) ) as Circle;
c2.x = size * 2 + 50;
c2.rotationX = -25;
c2.rotationY = 90-22;
//c1.rotationX = c2.rotationX = -25;
container.x = (465 - container.width)/2;
container.y = (465 - container.height)/2;
graphics.beginFill( 0xCCCCCC );
graphics.drawRect(0,0, 465,465);
graphics.endFill();
}
}
}
import flash.display.Graphics;
import flash.display.Shape;
class Circle extends Shape
{
public function Circle( size:int )
{
var g:Graphics = graphics;
g.lineStyle( 1,0xFF0000 );
g.beginFill( 0xFFFFFF,0.4 )
g.drawCircle( 0,0, size );
g.endFill();
g.drawCircle( 0,0, size/3 );
g.lineStyle( 1, 0x00FF00);
g.moveTo(0,-size);
g.lineTo(0,size);
g.lineStyle( 1,0xFF );
g.moveTo( -size,0 );
g.lineTo( size,0 );
}
}