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
   |  
program Project1;
uses
  Flash8;
 
 {$FRAME_WIDTH 550}
{$FRAME_HEIGHT 400}
{$FRAME_RATE 12}
{$JPEG  nom 'voeux2012.jpg'}
{$BACKGROUND $c0c0c0}
 
type
 TEssai=class(movieclip)
   window:Rectangle;
   mybmp: BitmapData;
   phot:movieclip;
   constructor Create(aowner:movieclip);
   procedure onMouseWheel(delta: Number; scrollTarget: TObject=nil);
 end;
 
constructor TEssai.Create(aowner:movieclip);
begin
 inherited Create(aowner,'container',aowner.getNextHighestDepth);
 _x:=(stage.width-520)/2;
 window:=Rectangle.Create(0,0,520, 2*366);
 scrollrect:=window; //je vois pas trop le changement de fluidité avec la méthode...
 mybmp := loadBitmap('nom');
 attachBitmap(mybmp,0,'',true);
 phot:=movieclip.Create(self,'phot',2);
 phot. attachBitmap(mybmp,0,'',true);
 phot._y:=366;
 mouse.Addlistener(self);
end;
 
 
procedure TEssai.onMouseWheel(delta: Number; scrollTarget: TObject);
begin
 if delta>0 then delta:=10 else delta:=-10;
 if (_y<=0)  and (_y>-732) then _y :=_y+ delta else  _y:=0;;
end;
 
begin
 TEssai.Create(_root);
end. | 
Partager