Guest User

Untitled

a guest
Oct 18th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. package {
  2.  
  3. import flash.display.MovieClip;
  4. import flash.display.Shape;
  5.  
  6.  
  7. public class claseDocumentoMC extends MovieClip {
  8.  
  9.  
  10. public function claseDocumentoMC() {
  11. var color:uint = 0xFF0000;
  12.  
  13. for(var i=0; i < 30; i++)
  14. {
  15. var micuadro:Shape = this.crearRectanguloRedondeado(color, 30, 30, 10, 10);
  16. addChild(micuadro);
  17. micuadro.x = (micuadro.width + 5) * i;
  18. micuadro.y = 100;
  19.  
  20. color += 0xFFCC00;
  21. }
  22. }
  23.  
  24. //Crea un recuadro con bordes redondeados
  25. public function crearRectanguloRedondeado(color:uint, ancho:Number, alto:Number, anchoElipse:Number, altoElipse:Number):Shape
  26. {
  27. var my_shape:Shape = new Shape();
  28. my_shape.graphics.beginFill(color);
  29. my_shape.graphics.drawRoundRect(0, 0, ancho, alto, anchoElipse, altoElipse);
  30. my_shape.graphics.endFill();
  31. return my_shape;
  32. }
  33. }
  34.  
  35. }
Add Comment
Please, Sign In to add comment