[Flashcoders] Re: Drawing Advanced Shape

2007-09-07 Thread macromedia flash
Hi guys..I tried to draw this shapes, but doesn't work for me, does anybody
can help me on this? or is there any Tutorials I can learn about ti? I
really have to finish it by the end of day..
thanks

http://www.minlab.net/upload/files/shapes.swf


Have a nice weekend

On 9/6/07, macromedia flash [EMAIL PROTECTED] wrote:

 Hi guys,

 I uses AS3 to draw a shape with gradient as below, now I am going to draw
 more complex shape.. can you please help me on this? == 
 http://www.minlab.net/upload/files/shapes.swf



 =

 package {
 import flash.display.DisplayObject;
 import flash.display.Graphics ;
 import flash.display.Shape;
 import flash.display.Sprite;
 import flash.display.GradientType
 import flash.display.SpreadMethod
 import flash.geom.*

 public class GraphicsExample extends Sprite {
 private var shapeWidth:uint   = 500;
 private var shapeHeight:uint  = 20;
 //private var bgColor:uint= 0xFFCC00;
 private var borderColor:uint  = 0x00;
 private var borderSize:uint   = 2;
 private var cornerRadius:uint = 6;
 private var xPostion:int  = 20;
 private var yPostion:int  = 20;

 public function GraphicsExample() {

 doDrawShape();
 }
 private function doDrawShape():void {
 var child:Shape = new Shape();

   var fillType:String = GradientType.LINEAR;
   var colors:Array = [0x00, 0x66];
  var alphas:Array = [100, 100];
   var ratios:Array = [0, 255];
 var matr:Matrix = new Matrix();

 matr.createGradientBox(shapeWidth,shapeHeight, Math.PI / 2, 0,
 0);
 var spreadMethod:String = SpreadMethod.PAD;

 child.graphics.lineStyle(borderSize, borderColor);

 child.graphics.beginGradientFill(fillType, colors, alphas,
 ratios, matr, spreadMethod);
 child.graphics.drawRoundRect(xPostion, 10, shapeWidth,
 shapeHeight, cornerRadius);
 addChild(child);
 }

 }
 }
 =

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Re: Drawing Advanced Shape

2007-09-07 Thread Hal Leonard
You'll probably have to use the lineTo function in order to draw a compound
shape like that.

Hal

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of macromedia
flash
Sent: Friday, September 07, 2007 11:11 AM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] Re: Drawing Advanced Shape

Hi guys..I tried to draw this shapes, but doesn't work for me, does anybody
can help me on this? or is there any Tutorials I can learn about ti? I
really have to finish it by the end of day..
thanks

http://www.minlab.net/upload/files/shapes.swf


Have a nice weekend

On 9/6/07, macromedia flash [EMAIL PROTECTED] wrote:

 Hi guys,

 I uses AS3 to draw a shape with gradient as below, now I am going to draw
 more complex shape.. can you please help me on this? ==
http://www.minlab.net/upload/files/shapes.swf



 =

 package {
 import flash.display.DisplayObject;
 import flash.display.Graphics ;
 import flash.display.Shape;
 import flash.display.Sprite;
 import flash.display.GradientType
 import flash.display.SpreadMethod
 import flash.geom.*

 public class GraphicsExample extends Sprite {
 private var shapeWidth:uint   = 500;
 private var shapeHeight:uint  = 20;
 //private var bgColor:uint= 0xFFCC00;
 private var borderColor:uint  = 0x00;
 private var borderSize:uint   = 2;
 private var cornerRadius:uint = 6;
 private var xPostion:int  = 20;
 private var yPostion:int  = 20;

 public function GraphicsExample() {

 doDrawShape();
 }
 private function doDrawShape():void {
 var child:Shape = new Shape();

   var fillType:String = GradientType.LINEAR;
   var colors:Array = [0x00, 0x66];
  var alphas:Array = [100, 100];
   var ratios:Array = [0, 255];
 var matr:Matrix = new Matrix();

 matr.createGradientBox(shapeWidth,shapeHeight, Math.PI / 2, 0,
 0);
 var spreadMethod:String = SpreadMethod.PAD;

 child.graphics.lineStyle(borderSize, borderColor);

 child.graphics.beginGradientFill(fillType, colors, alphas,
 ratios, matr, spreadMethod);
 child.graphics.drawRoundRect(xPostion, 10, shapeWidth,
 shapeHeight, cornerRadius);
 addChild(child);
 }

 }
 }
 =

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com