Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package {
- import flash.display.MovieClip;
- import flash.display.Shape;
- public class claseDocumentoMC extends MovieClip {
- public function claseDocumentoMC() {
- var color:uint = 0xFF0000;
- for(var i=0; i < 30; i++)
- {
- var micuadro:Shape = this.crearRectanguloRedondeado(color, 30, 30, 10, 10);
- addChild(micuadro);
- micuadro.x = (micuadro.width + 5) * i;
- micuadro.y = 100;
- color += 0xFFCC00;
- }
- }
- //Crea un recuadro con bordes redondeados
- public function crearRectanguloRedondeado(color:uint, ancho:Number, alto:Number, anchoElipse:Number, altoElipse:Number):Shape
- {
- var my_shape:Shape = new Shape();
- my_shape.graphics.beginFill(color);
- my_shape.graphics.drawRoundRect(0, 0, ancho, alto, anchoElipse, altoElipse);
- my_shape.graphics.endFill();
- return my_shape;
- }
- }
- }
Add Comment
Please, Sign In to add comment