Adobe clock sample

Submitted by GROL on 12 October, 2010 - 23:28

The clock can be moved and resized with mouse wheel. When holding Ctrl button, one can change transparency of the clock. 

Note. Flash Viewer Engine is needed.

Source archive: adobeclock.zip (0.6Mb)
 

 
Some sample source: 
procedure TForm4.FormCreate(Sender: TObject);
begin
  FlashViewer.Align := alNone;
  FlashViewer.SetBounds(0, 0, ClientWidth, ClientHeight);
  FlashViewer.Movie := 'clock-transparent.swf';
  FlashViewer.OnMouseDown := FormMouseDown;
  FlashViewer.OnMouseMove := FormMouseMove;
  FlashViewer.OnMouseUp := FormMouseUp;
end;
 
procedure TForm4.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  ptDown := Point(X, Y);
  isDown := true;
end;
 
procedure TForm4.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  if isDown and ((X <> ptDown.X) or (Y <> ptDown.Y)) then
  begin
    Left := Left + X - ptDown.X;
    Top := Top + Y - ptDown.Y;
  end
end;
 
procedure TForm4.FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  isDown := false;
end;
 
procedure TForm4.FormMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint;
  var Handled: Boolean);
begin
  if Shift = [ssCtrl] then
    FlashViewer.MasterAlpha := Max(50, FlashViewer.MasterAlpha - sign(WheelDelta) * 5)
  else
 if Shift = [] then
  begin
    if ((WheelDelta > 0) and (Width > 40)) or (WheelDelta < 0) then
      SetBounds(Left + sign(WheelDelta) * 5, Top + sign(WheelDelta) * 5,
                Width - sign(WheelDelta) * 10, Height - Sign(WheelDelta) * 10);
    FlashViewer.SetBounds(0, 0, ClientWidth, ClientHeight);
  end
end;