Salut, sur un petit truc tout simple, je n'arrive pas à comprendre pourquoi mon événement onPress est inopérant...

ci-joint :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
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
 
program Pgris;
 
{$FRAME_WIDTH 1000}
{$FRAME_HEIGHT 520}
 
uses
  Flash8;
 
type
  TPixel=class(MovieClip)
   constructor Create(parent:MovieClip;couleur:number;x,y:integer);
   procedure onPress;override;
  end;
 
 var
     pixel: array[0..5,0..6] of TPixel;
     i,j:integer;
 
const col: array[0..6,0..5] of integer =(($d4ce6d,$CDC861,$cdc861,$c7c35a,$cbc761,$d1ce6c),($bbb54a,$f2ecd9,$ffffff,$ffffff,$f5f4e6,$c2bb54),($9d9629,$f5f4e0,$877e17,$948b23,$aaa63d,$b1ad44),($8e8720,$f2f1d7,$ffffff,$f2f1e3,$b6b14b,$a9a23b),($8b8221,$efeed4,$74690f,$8b8522,$aca43f,$9e9835),($8f8729,$e6e5c3,$fffeff,$ffffff,$f1f1e3,$9b9536),($a39b3e,$928A2D,$867e25,$8a8228,$999137,$a8a144));
 
 
Constructor TPixel.Create(parent:MovieClip;couleur:number;x,y:integer);
begin
   inherited Create(parent,'Pixel' + IntToStr(x) + IntToStr(y),parent.getNextHighestDepth());
   opaquebackground:=couleur;
   moveto(0,0);
   lineto(stage.height/7,stage.height/7);
end;
 
 
procedure TPixel.onPress;
begin
//mon action
end;
 
 
begin
 for i:=0 to 5 do
 for j:=0 to 6 do
  begin
   pixel[i,j]:=TPixel.Create(_root,col[j,i],i,j);
   with pixel[i,j] do
   begin
    _x:=_width*i;
    _y:=_height*j;
   end;
 end;
end.
le but étant de changer la couleur de chaque pixel en niveau de gris...

Je me prends la tête avec ça depuis hier et je ne comprends pas mon erreur...