| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 
 |  
program matrice01;
 
{$FRAME_WIDTH 400}
{$FRAME_HEIGHT 400}
 
uses
  Flash8;
 
type
  tImage = class(movieClip)
    constructor Create(name: string; x, y: integer);
    procedure Carre(taille: integer);
    procedure Remplissage(couleur: integer);
  end;
 
  tMatrice = class
    matrixType: string;
    x,y,w,h   : double;
    r         : double;
    constructor Create;
  end;
 
constructor tImage.Create(name: string; x, y: integer);
begin
  inherited Create(nil, name, _root.GetNextHighestDepth());
  _x := x;
  _y := y;
end;
 
procedure tImage.Carre(taille: integer);
begin
  taille := taille div 2;
  MoveTo(-taille, +taille);
  LineTo(-taille, -taille);
  LineTo(+taille, -taille);
  LineTo(+taille, +taille);
  LineTo(-taille, +taille);
end;
 
var
  matrice: tMatrice;
 
procedure tImage.Remplissage(couleur: integer);
begin
  Clear;
  LineStyle(0, couleur);
  BeginGradientFill('radial', [$ffffff,couleur], [100,100], [0,255], matrice);
  Carre(300);
  EndFill;
end;
 
constructor tMatrice.Create;
begin
  matrixType := 'box';
  x := -75;
  y := -75;
  w := 150;
  h := 150;
  r := 0;
end;
 
var
  i: tImage;
 
begin
  matrice := tMatrice.Create;
  i := tImage.Create('', 200, 200);
  i.Remplissage($6600FF); { PersianBlue }
end. | 
Partager