Home | Delphi SWF SDK | SlideShow Engine | Free source samples | Code library | Forum | Blog | Contact

Delphi SWF SDK

 

Demo with source

The part of code that creates this banner is below.

Discuss or ask at the forum>>
Download full delphi project BannerMaker binary (380Kb) and source.

The part of code UBanner.pas

  1. unit UBanner;
  2.  
  3. interface
  4.  
  5. uses
  6. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7. Dialogs, StdCtrls, ExtCtrls;
  8.  
  9. type
  10. TForm1 = class(TForm)
  11. Button1: TButton;
  12. SD: TSaveDialog;
  13. vclD: TImage;
  14. vclF: TImage;
  15. Button2: TButton;
  16. procedure Button1Click(Sender: TObject);
  17. procedure Button2Click(Sender: TObject);
  18. private
  19. { Private declarations }
  20. public
  21. { Public declarations }
  22. end;
  23.  
  24. var
  25. Form1: TForm1;
  26. implementation
  27. uses FlashObjects, SWFConst, SWFTools, ShellAPI, Math, SWFObjects;
  28.  
  29. {$R *.dfm}
  30. const _FPS = 14;
  31.  
  32. Function CalcFrame(sec: single): word;
  33. begin
  34. Result := Round(sec * _FPS);
  35. if Result = 0 then Result := 1;
  36. end;
  37.  
  38. Function Ease(k, x: single; less: boolean): single;
  39. begin
  40. if X = 0 then Result := 0
  41. else Result := Exp( (1 + k ) * Ln(Abs(x)));
  42. if less then Result := 1 - Result;
  43. end;
  44.  
  45. // =====================================================================
  46. // |
  47. // 468 x 60 |
  48. // |
  49. // =====================================================================
  50.  
  51. procedure TForm1.Button1Click(Sender: TObject);
  52. var
  53. il, FrCount: word;
  54. Movie: TFlashMovie;
  55. fntTahoma, fntCourier, fntDinCond: TFlashFont;
  56. Txt1, Txt2: TFLashText;
  57. SprButton1, SprButton2, SprStrel, TotalMC, ButEdg: TFlashSprite;
  58. ButSee, ButReply: TFlashButton;
  59. RR1, RR2, Strel, rImageD, rImageF, WhiteRect, Ballon: TFlashShape;
  60. imgD, imgF: TFlashImage;
  61. MTime: single;
  62. label1, label2: TSWFOffsetMarker;
  63.  
  64. Procedure FadeOut;
  65. var il: word;
  66. begin
  67. For il := 0 to CalcFrame(0.6) do
  68. with Movie.PlaceObject(WhiteRect, 103) do
  69. begin
  70. SetScale(1, 10);
  71. ColorTransform.addA := Round((il - CalcFrame(0.6)) / CalcFrame(0.6) * $FF);
  72. if il > 0 then RemoveDepth := true;
  73. Movie.ShowFrame;
  74. end;
  75. end;
  76.  
  77. Procedure FadeIn;
  78. var il: word;
  79. begin
  80. For il := 0 to CalcFrame(0.6) do
  81. with Movie.PlaceObject(WhiteRect, 103) do
  82. begin
  83. SetScale(1, 10);
  84. ColorTransform.addA := - Round(il / CalcFrame(0.6) * $FF);
  85. if il > 0 then RemoveDepth := true;
  86. Movie.ShowFrame;
  87. end;
  88. end;
  89.  
  90. begin
  91. if not SD.Execute then Exit;
  92. Movie := TFlashMovie.Create(0, 0, 468, 60, _FPS, scPix);
  93. Movie.Compressed := true;
  94. Movie.Protect := true;
  95.  
  96. // set movie background
  97. Movie.BackgroundColor.RGB := SWFRGB(clWhite);
  98.  
  99. // add font objects to use
  100. fntTahoma := Movie.AddFont(Font);
  101. fntTahoma.AntiAlias := true;
  102.  
  103. fntCourier := Movie.AddFont(Font);
  104. fntCourier.Name := 'Courier New';
  105. fntCourier.Bold := true;
  106. fntCourier.Size := 20;
  107.  
  108. fntDinCond := Movie.AddFont(Font);
  109. fntDinCond.Name := 'DinCond';
  110. fntDinCond.Size := 40;
  111.  
  112. //============================= SCENE 1 ============================================
  113. Movie.AddRectangle(0, 0, 468, 60).SetSolidColor(cswfTransparent);
  114. With Movie.AddButton(false, false) do
  115. begin
  116. AddRecord(Movie.Shapes[0], SWFButtonStateAll);
  117. OnClickActions.GetUrl('http://www.torry.net/cgi-bin/banners.fpl?region=34&campaign=266&banner=245&mode=CLICK', '_blank');
  118. end;
  119. Movie.PlaceObject(Movie.Buttons[0], 200);
  120.  
  121. Txt1 := Movie.AddText('This banner is created by', SWFRGBA(clBlack), fntCourier, Point(83, 8));
  122. Movie.PlaceObject(Txt1, 100);
  123.  
  124. // make the edit caret
  125. WhiteRect := Movie.AddRectangle(0, 0, 468, 22);
  126. WhiteRect.SetSolidColor(cswfWhite);
  127. Strel := Movie.AddLine(0, 0, 0, 22);
  128. Strel.SetLineStyle(2, cswfBlack);
  129. SprStrel := movie.AddSprite;
  130. SprStrel.PlaceObject(WhiteRect, 1);
  131. SprStrel.PlaceObject(Strel, 2);
  132. SprStrel.ShowFrame(CalcFrame(0.4));
  133. SprStrel.RemoveObject(2);
  134. SprStrel.ShowFrame(CalcFrame(0.4));
  135.  
  136. // move the caret alike entering the first line text
  137. for il := 0 to length(Txt1.Text) do
  138. with Movie.PlaceObject(SprStrel, 103) do
  139. begin
  140. SetTranslate(83 + il*12, 8);
  141. Movie.ShowFrame(CalcFrame(0.15));
  142. if il = 0 then Movie.ShowFrame(CalcFrame(1.45))
  143. else RemoveDepth := true;
  144. end;
  145.  
  146. Movie.ShowFrame(CalcFrame(1));
  147.  
  148. Txt1 := Movie.AddText('Delphi SWF SDK', SWFRGBA(clRed), fntCourier, Point(150, 30));
  149. Movie.PlaceObject(Txt1, 101);
  150.  
  151. // move the caret alike entering the second line text
  152. for il := 0 to length(Txt1.Text) do
  153. with Movie.PlaceObject(SprStrel, 103) do
  154. begin
  155. SetTranslate(150 + il*12, 30);
  156. Movie.ShowFrame(CalcFrame(0.15));
  157. if il = 0 then Movie.ShowFrame(CalcFrame(1.45));
  158. RemoveDepth := true;
  159. end;
  160.  
  161. Movie.ShowFrame(CalcFrame(0.5));
  162. Movie.RemoveObject(103);
  163. Movie.ShowFrame(CalcFrame(0.5));
  164.  
  165. FadeOut;
  166.  
  167. Movie.RemoveObject(100);
  168. Movie.RemoveObject(101);
  169.  
  170. // ========================= Scene 2 ======================================
  171.  
  172. // create image data from bitmap
  173. imgD := Movie.AddImage;
  174. imgD.LoadDataFromHandle(vclD.Picture.Bitmap.Handle);
  175.  
  176. rImageD :=Movie.AddShapeImage(imgD);
  177. Movie.PlaceObject(rImageD, 1).SetTranslate(150, 0);
  178. Txt1 := Movie.AddText('Delphi', SWFRGBA(51, 51, 153, 255), fntDinCond, Point(220, 5));
  179. Movie.PlaceObject(Txt1, 10);
  180.  
  181. FadeIn;
  182. Movie.ShowFrame(CalcFrame(0.5));
  183. FadeOut;
  184.  
  185. Movie.RemoveObject(1);
  186. Movie.RemoveObject(10);
  187. // ========================= Scene 3 ======================================
  188.  
  189. Txt1 := Movie.AddText('+', SWFRGBA(51, 51, 153, 255), fntDinCond, Point(230, 5));
  190. Movie.PlaceObject(Txt1, 10);
  191. FadeIn;
  192. Movie.ShowFrame(CalcFrame(0.2));
  193. FadeOut;
  194. Movie.RemoveObject(10);
  195. // ========================= Scene 4 ======================================
  196.  
  197. imgF := Movie.AddImage;
  198. imgF.LoadDataFromHandle(vclF.Picture.Bitmap.Handle);
  199.  
  200. rImageF :=Movie.AddShapeImage(imgF);
  201. Movie.PlaceObject(rImageF, 1).SetTranslate(150, 6);
  202. Txt1 := Movie.AddText('Flash', SWFRGBA(51, 51, 153, 255), fntDinCond, Point(220, 5));
  203. Movie.PlaceObject(Txt1, 10);
  204.  
  205. FadeIn;
  206. Movie.ShowFrame(CalcFrame(0.5));
  207. FadeOut;
  208.  
  209. Movie.RemoveObject(1);
  210. Movie.RemoveObject(10);
  211.  
  212. // ========================= Scene 5 ======================================
  213.  
  214. Txt1 := Movie.AddText('et crossroad two technologies', SWFRGBA(51, 51, 153, 255), fntDinCond, Point(30, 5));
  215. Movie.PlaceObject(Txt1, 10);
  216. FadeIn;
  217. Movie.ShowFrame(CalcFrame(2));
  218. FadeOut;
  219. Movie.RemoveObject(10);
  220.  
  221. // ========================= TotalMC ======================================
  222.  
  223. TotalMC := Movie.AddSprite;
  224.  
  225. // balls
  226. Ballon := Movie.AddCircle(0, 0, 5);
  227. Ballon.SetRadialGradient(SWFRGBA($FF, $FF, $DD, $FF), SWFRGBA(clNavy), 35, 35);
  228. TotalMC.PlaceObject(Ballon, 30).SetTranslate(170, 11);
  229. TotalMC.PlaceObject(Ballon, 31).SetTranslate(315, 11);
  230. TotalMC.PlaceObject(Ballon, 9).SetTranslate(242, 53);
  231.  
  232. // images
  233. TotalMC.PlaceObject(rImageD, 1).SetTranslate(85, 0);
  234. TotalMC.PlaceObject(rImageF, 2).SetTranslate(350, 6);
  235.  
  236. // text
  237. Txt1 := Movie.AddText('Delphi + Flash', SWFRGBA(51, 51, 153, 255), fntDinCond, Point(0, 0));
  238. With TotalMC.PlaceObject(Txt1, 20) do
  239. begin
  240. SetPosition(185, -2);
  241. SetScale(0.55, 0.55);
  242. end;
  243. // white background
  244. With TotalMC.PlaceObject(Txt1, 19) do
  245. begin
  246. SetPosition(187, -1);
  247. SetScale(0.55, 0.55);
  248. ColorTransform.addR := $FF;
  249. ColorTransform.addG := $FF;
  250. ColorTransform.addB := $FF;
  251. end;
  252. With TotalMC.PlaceObject(Txt1, 18) do
  253. begin
  254. SetPosition(184, -1);
  255. SetScale(0.55, 0.55);
  256. ColorTransform.addR := $FF;
  257. ColorTransform.addG := $FF;
  258. ColorTransform.addB := $FF;
  259. end;
  260.  
  261. Txt1 := Movie.AddText('Delphi SWF SDK', cswfRed, fntDinCond, Point(0, 0));
  262. With TotalMC.PlaceObject(Txt1, 17) do
  263. begin
  264. SetPosition(182, 25);
  265. SetScale(0.55, 0.55);
  266. end;
  267. // white background
  268. With TotalMC.PlaceObject(Txt1, 16) do
  269. begin
  270. SetPosition(184, 25);
  271. SetScale(0.55, 0.55);
  272. ColorTransform.addR := $FF;
  273. ColorTransform.addG := $FF;
  274. ColorTransform.addB := $FF;
  275. end;
  276. With TotalMC.PlaceObject(Txt1, 15) do
  277. begin
  278. SetPosition(181, 25);
  279. SetScale(0.55, 0.55);
  280. ColorTransform.addR := $FF;
  281. ColorTransform.addG := $FF;
  282. ColorTransform.addB := $FF;
  283. end;
  284.  
  285.  
  286. TotalMC.FrameActions.Stop;
  287. TotalMC.ShowFrame;
  288.  
  289. // drawing oval
  290. SprStrel := Movie.AddSprite;
  291. For il := 1 to CalcFrame(1) do
  292. begin
  293. RR1 := Movie.AddArc(0, 0, 61, - 45, il / CalcFrame(1) * 360 - 45, false);
  294. RR1.SetLineStyle(1, SWFRGBA(clNavy));
  295. with SprStrel.PlaceObject(RR1, 1) do
  296. begin
  297. SetScale(1, 0.2);
  298. SetSkew(0, - 0.34);
  299. if il > 1 then RemoveDepth := true;
  300. end;
  301.  
  302. if il = CalcFrame(1) then
  303. With SprStrel.FrameActions do
  304. begin
  305. Stop;
  306. SetTarget('_parent');
  307. Play;
  308. end;
  309. SprStrel.ShowFrame;
  310. end;
  311. TotalMC.PlaceObject(SprStrel, 3).SetTranslate(275, 33);
  312. With TotalMC.PlaceObject(SprStrel, 4) do
  313. begin
  314. SetTranslate(210, 33);
  315. SetScale(-1, 1);
  316. end;
  317. // sprite is stoped and will be playing at the next scene of the movie
  318. TotalMC.FrameActions.Stop;
  319. TotalMC.ShowFrame;
  320.  
  321. // star and ball at the ovals crossing
  322. RR2 := Movie.AddStar(0, 0 , 25, -15, 10);
  323. RR2.SetRadialGradient(SWFRGBA($FF, $80, $00, $FF), SWFRGBA($FA, $FA, $FA, $FA), 50, 50);
  324. with TotalMC.PlaceObject(RR2, 10) do
  325. begin
  326. SetTranslate(242, 53);
  327. SetScale(0.5, 0.7);
  328. end;
  329. TotalMC.ShowFrame;
  330.  
  331. with TotalMC.PlaceObject(RR2, 10) do
  332. begin
  333. SetTranslate(242, 53);
  334. SetScale(1.1, 0.8);
  335. RemoveDepth := true;
  336. end;
  337. TotalMC.ShowFrame;
  338.  
  339. with TotalMC.PlaceObject(RR2, 10) do
  340. begin
  341. SetTranslate(242, 53);
  342. SetScale(1.1, 1.2);
  343. ColorTransform.addA := - 60;
  344. RemoveDepth := true;
  345. end;
  346.  
  347. TotalMC.ShowFrame;
  348.  
  349. with TotalMC.PlaceObject(RR2, 10) do
  350. begin
  351. SetTranslate(242, 53);
  352. SetScale(1.1, 1.2);
  353. ColorTransform.addA := - 180;
  354. RemoveDepth := true;
  355. end;
  356.  
  357. TotalMC.RemoveObject(10);
  358.  
  359. TotalMC.ShowFrame(CalcFrame(0.5));
  360. with TotalMC.FrameActions do
  361. begin
  362. Stop;
  363. SetTarget('_root');
  364. Play;
  365. SetTarget('');
  366. end;
  367. TotalMC.ShowFrame;
  368.  
  369. // light is running over the oval
  370. SprStrel := Movie.AddSprite;
  371. For il := 1 to CalcFrame(1) do
  372. begin
  373. RR1 := Movie.AddArc(0, 0, 61, il/ CalcFrame(1) * 360, (il + 0.5) / CalcFrame(1) * 360, false);
  374. RR1.SetLineStyle(3, SWFRGBA(255, 196, 69, $EE));
  375. with SprStrel.PlaceObject(RR1, 1) do
  376. begin
  377. SetScale(1, 0.2);
  378. SetSkew(0, - 0.34);
  379. if il > 1 then RemoveDepth := true;
  380. end;
  381. SprStrel.ShowFrame;
  382. end;
  383. TotalMC.PlaceObject(SprStrel, 5).SetTranslate(275, 33);
  384.  
  385. With TotalMC.PlaceObject(SprStrel, 7) do
  386. begin
  387. SetTranslate(210, 33);
  388. SetScale(-1, 1);
  389. Name := 'd1';
  390. end;
  391. // the second oval lightening begins to play from the second part to get lights
  392. // to run in different phases
  393. With TotalMC.FrameActions do
  394. begin
  395. Stop;
  396. SetTarget('d1');
  397. GotoAndPlay(CalcFrame(0.5));
  398. end;
  399. TotalMC.ShowFrame;
  400.  
  401. // place TotalMC at the scene
  402. Movie.PlaceObject(TotalMC, 1).Name := 'total';
  403.  
  404. FadeIn;
  405. Movie.ShowFrame(CalcFrame(0.5));
  406.  
  407. with Movie.FrameActions do
  408. begin
  409. Stop;
  410. SetTarget('total');
  411. Play;
  412. end;
  413. Movie.ShowFrame;
  414.  
  415.  
  416. // ==================================== Button 'See source' ==================================
  417. RR1 := Movie.AddRoundRect(Rect(0, 0, 80, 20), 4);
  418. RR1.SetLineStyle(1, cswfGray70);
  419. RR1.SetSolidColor(cswfWhite);
  420.  
  421. RR2 := Movie.AddRoundRect(Rect(2, 2, 78, 18), 2);
  422. RR2.SetLineStyle(1, cswfGray30);
  423. RR2.SetSolidColor(SWFRGBA(240, 240, 240, 255));
  424.  
  425. Strel := Movie.AddShape;
  426. Strel.SetShapeBound(-4, -2, 4, 4);
  427. Strel.SetLineStyle(1, cswfGray80);
  428. With Strel.Edges do
  429. begin
  430. MoveTo(-3, -4);
  431. LineTo(0, 0);
  432. LineTo(-3, 4);
  433. MoveTo(0, -4);
  434. LineTo(3, 0);
  435. LineTo(0, 4)
  436. end;
  437.  
  438. SprStrel := Movie.AddSprite;
  439. for il := 1 to CalcFrame(0.5) do
  440. with SprStrel.PlaceObject(Strel, 1) do
  441. begin
  442. SetTranslate(70, 11);
  443. ColorTransform.addA := - il * 25;
  444. if il > 1 then RemoveDepth := true;
  445. SprStrel.ShowFrame;
  446. end;
  447. for il := CalcFrame(0.5) downto 1 do
  448. with SprStrel.PlaceObject(Strel, 1) do
  449. begin
  450. SetTranslate(70, 11);
  451. ColorTransform.addA := - il * 25;
  452. RemoveDepth := true;
  453. SprStrel.ShowFrame;
  454. end;
  455.  
  456. Txt1 := Movie.AddText('See source', cswfGray80, fntTahoma, Point(7, 3));
  457.  
  458. ButEdg := Movie.AddSprite;
  459. ButEdg.PlaceObject(RR1, 1);
  460. ButEdg.PlaceObject(RR2, 2);
  461.  
  462. SprButton1 := Movie.AddSprite;
  463. SprButton1.PlaceObject(ButEdg, 1);
  464. SprButton1.PlaceObject(Txt1, 3);
  465. SprButton1.PlaceObject(SprStrel, 4);
  466. SprButton1.ShowFrame;
  467.  
  468. SprButton2 := Movie.AddSprite;
  469. SprButton2.PlaceObject(ButEdg, 1);
  470. SprButton2.PlaceObject(Txt1, 3).SetTranslate(1, 1);
  471. SprButton2.PlaceObject(SprStrel, 4).SetTranslate(1, 1);
  472. SprButton2.ShowFrame;
  473.  
  474. ButSee := Movie.AddButton;
  475. ButSee.AddRecord(RR1, [bsHitTest]);
  476. with ButSee.AddRecord(SprButton1, [bsUp]).ColorTransform do
  477. begin
  478. addB := 70;
  479. addA := -50;
  480. end;
  481. with ButSee.AddRecord(SprButton1, [bsOver]).ColorTransform do
  482. begin
  483. addR := 90;
  484. addG := 30;
  485. addB := -20;
  486. end;
  487. ButSee.AddRecord(SprButton2, [bsDown]).ColorTransform.addB := 70;
  488.  
  489. // ButSee.OnClickActions.GetUrl('http://www.delphiflash.com/sdk_demo2.html', '_blank');
  490. ButSee.OnClickActions.GetUrl('http://www.torry.net/cgi-bin/banners.fpl?region=34&campaign=266&banner=245&mode=CLICK', '_blank');
  491.  
  492. // ==================================== Button 'Repeat' ==================================
  493. Txt1 := Movie.AddText('Play again', cswfGray80, fntTahoma, Point(7, 3));
  494.  
  495. SprButton1 := Movie.AddSprite;
  496. SprButton1.PlaceObject(ButEdg, 1);
  497. SprButton1.PlaceObject(Txt1, 3);
  498. RR2 := Movie.AddShape;
  499. // RR2.SetShapeBound(-7, -4, 1, 0);
  500. RR2.SetLineStyle(1, cswfGray80);
  501. With RR2.Edges do
  502. begin
  503. MakeArc(0, 0, 5, 190, 160, false);
  504. MoveTo( -6, -3);
  505. LineTo( -5, 0);
  506. LineTo( -3, -2);
  507. RR2.Bounds.Rect := GetBoundsRect;
  508. end;
  509.  
  510.  
  511. with SprButton1.PlaceObject(RR2, 4) do
  512. begin
  513. SetTranslate(68, 10);
  514. end;
  515. SprButton1.ShowFrame;
  516.  
  517. SprButton2 := Movie.AddSprite;
  518. SprButton2.PlaceObject(ButEdg, 1);
  519. SprButton2.PlaceObject(Txt1, 3).SetTranslate(1, 1);
  520. with SprButton2.PlaceObject(RR2, 4) do
  521. begin
  522. SetTranslate(69, 11);
  523. end;
  524.  
  525. SprButton2.ShowFrame;
  526.  
  527. ButReply := Movie.AddButton;
  528. ButReply.AddRecord(RR1, [bsHitTest]);
  529. with ButReply.AddRecord(SprButton1, [bsUp]).ColorTransform do
  530. begin
  531. addB := 70;
  532. addA := -50;
  533. end;
  534.  
  535. with ButReply.AddRecord(SprButton1, [bsOver]).ColorTransform do
  536. begin
  537. addR := 90;
  538. addG := 30;
  539. addB := -20;
  540. end;
  541. ButReply.AddRecord(SprButton2, [bsDown]).ColorTransform.addB := 70;
  542.  
  543. with ButReply.OnClickActions do
  544. begin
  545. SetTarget('_root');
  546. Play;
  547. end;
  548.  
  549. //================================ Rolled text =======================================
  550. RR2 := Movie.AddRectangle(200, 0, 468, 10);
  551. RR2.SetLinearGradient(SWFRGBA(255,255,255,0), cswfWhite, 90);
  552.  
  553. txt2 := Movie.AddText('- visual objects creating (shape, button, text);<br>'+
  554. '- advanced objects (morphing shape, sprite);<br>'+
  555. '- all types of filling (solid, gradient, image);<br>'+
  556. '- device and embedding fonts;<br>'+
  557. '- sound (events, streaming);<br>'+
  558. '- video;<br>'+
  559. '- action commands;<br>'+
  560. '- any transition and transformation;<br>'+
  561. 'etc.', SWFRGBA(clNavy), fntTahoma, Rect(220, 60, 468, 200));
  562. txt2.NoSelect := true;
  563. txt2.HTML := true;
  564. txt2.UseOutlines := true;
  565. txt2.AutoSize := true;
  566.  
  567. SprStrel := Movie.AddSprite;
  568. With SprStrel.PlaceObject(WhiteRect, 1) do
  569. begin
  570. SetScale(1, 4);
  571. SetTranslate(200, 0);
  572. end;
  573.  
  574. SprStrel.PlaceObject(txt2, 5).Name := 'roll';
  575. SprStrel.PlaceObject(RR2, 10);
  576. With SprStrel.PlaceObject(RR2, 11) do
  577. begin
  578. SetScale(1, -1);
  579. SetTranslate(0, 50);
  580. end;
  581. SprStrel.PlaceObject(WhiteRect, 12).SetTranslate(200, 50);
  582.  
  583. SprStrel.ShowFrame;
  584.  
  585. // ==================================== Last scene ==================================
  586. Movie.RemoveObject(200);
  587. MTime := 0.7;
  588. FrCount := CalcFrame(MTime);
  589.  
  590. With Movie.PlaceObject(WhiteRect, 45) do
  591. begin
  592. SetScale(1, 4);
  593. SetTranslate(200, 0);
  594. end;
  595.  
  596. for il := 0 to FrCount do
  597. begin
  598. with Movie.PlaceObject(45) do
  599. begin
  600. ColorTransform.addA := - Round( $FF * (FrCount - il)/ FrCount);
  601. RemoveDepth := true;
  602. end;
  603.  
  604. with Movie.PlaceObject(TotalMC, 1) do
  605. begin
  606. SetTranslate( - Round( 145 * (Ease(3, (FrCount - il)/ FrCount, true))), 0);
  607. RemoveDepth := true;
  608. end;
  609.  
  610. With Movie.PlaceObject(ButReply, 51) do
  611. begin
  612. SetTranslate(300, 60 - Round(23 * (il)/ FrCount));
  613. if il > 0 then RemoveDepth := true;
  614. end;
  615.  
  616. With Movie.PlaceObject(ButSee, 50) do
  617. begin
  618. SetTranslate(383, 60 - Round(23 * (il)/ FrCount));
  619. if il > 0 then RemoveDepth := true;
  620. end;
  621.  
  622. Movie.PlaceObject(1).SetTranslate(il * 10, 0);
  623. Movie.ShowFrame;
  624. end;
  625.  
  626. With Movie.PlaceObject(SprStrel, 46).OnEnterFrame do
  627. begin
  628. ConstantPool(['roll', 'il']);
  629. Push([0, fpPosY, 0, fpPosY], [vtConstant8, vtInteger, vtConstant8, vtInteger]);
  630. GetProperty;
  631. Push([0, fpHeight], [vtConstant8, vtInteger]);
  632. GetProperty;
  633. Add2; // roll._y + roll._height
  634. Push(0);
  635. Less;
  636. label1 := _If.BranchOffsetMarker;
  637. Push([0, fpPosY], [vtConstant8, vtInteger]);
  638. GetProperty;
  639. Push(-0.5);
  640. Add;
  641. SetProperty;
  642. label2 := Jump.BranchOffsetMarker;
  643. SetMarker(label1);
  644. Push(60);
  645. SetProperty;
  646. PushConstant([1, 1, 1]);
  647. GetVariable;
  648. Increment;
  649. SetVariable;
  650. GetVariable;
  651. Push(3);
  652. Equals2;
  653. _Not;
  654. label1 := _If.BranchOffsetMarker;
  655. Stop;
  656. SetTarget('_root');
  657. Play;
  658. SetMarker(label1);
  659. SetMarker(label2);
  660. end;
  661.  
  662. with Movie.FrameActions do
  663. begin
  664. Stop;
  665. SetTarget('total');
  666. Play;
  667. end;
  668. Movie.ShowFrame;
  669. FadeOut;
  670.  
  671. Movie.MakeStream;
  672. Movie.SaveToFile(SD.FileName);
  673. Movie.Free;
  674.  
  675. ShellExecute(handle, PChar('open'), PChar(SD.FileName), nil, nil, sw_Normal);
  676. end;
  677.  
  678.  
  679. // =====================================================================
  680. // |
  681. // 125 x 160 |
  682. // |
  683. // =====================================================================
  684.  
  685. procedure TForm1.Button2Click(Sender: TObject);
  686. var
  687. il, FrCount: word;
  688. Movie: TFlashMovie;
  689. fntTahoma, fntCourier, fntDinCond: TFlashFont;
  690. Txt1, Txt2: TFLashText;
  691. SprButton1, SprButton2, SprStrel, TotalMC, ButEdg: TFlashSprite;
  692. ButSee: TFlashButton;
  693. RR1, RR2, Strel, rImageD, rImageF, WhiteRect, Ballon: TFlashShape;
  694. imgD, imgF: TFlashImage;
  695. MTime: single;
  696. label1, label2: TSWFOffsetMarker;
  697.  
  698. Procedure FadeOut;
  699. var il: word;
  700. begin
  701. For il := 0 to CalcFrame(0.6) do
  702. with Movie.PlaceObject(WhiteRect, 103) do
  703. begin
  704. SetScale(1, 10);
  705. ColorTransform.addA := Round((il - CalcFrame(0.6)) / CalcFrame(0.6) * $FF);
  706. if il > 0 then RemoveDepth := true;
  707. Movie.ShowFrame;
  708. end;
  709. end;
  710.  
  711. Procedure FadeIn;
  712. var il: word;
  713. begin
  714. For il := 0 to CalcFrame(0.6) do
  715. with Movie.PlaceObject(WhiteRect, 103) do
  716. begin
  717. SetScale(1, 10);
  718. ColorTransform.addA := - Round(il / CalcFrame(0.6) * $FF);
  719. if il > 0 then RemoveDepth := true;
  720. Movie.ShowFrame;
  721. end;
  722. end;
  723.  
  724. begin
  725. if not SD.Execute then Exit;
  726. Movie := TFlashMovie.Create(0, 0, 125, 160, _FPS, scPix);
  727. Movie.Compressed := true;
  728. Movie.Protect := true;
  729.  
  730. Movie.BackgroundColor.RGB := SWFRGB(clWhite);
  731.  
  732. fntTahoma := Movie.AddFont(Font);
  733. fntTahoma.AntiAlias := true;
  734.  
  735. fntCourier := Movie.AddFont(Font);
  736. fntCourier.Name := 'Courier New';
  737. fntCourier.Bold := true;
  738. fntCourier.Size := 14 ;
  739.  
  740. fntDinCond := Movie.AddFont(Font);
  741. fntDinCond.Name := 'DinCond';
  742. fntDinCond.Size := 40;
  743.  
  744. //============================= SCENE 1 ============================================
  745.  
  746. Txt1 := Movie.AddText('This banner', SWFRGBA(clBlack), fntCourier, Point(16, 45));
  747. Movie.PlaceObject(Txt1, 99);
  748.  
  749. WhiteRect := Movie.AddRectangle(0, 0, 468, 22);
  750. WhiteRect.SetSolidColor(cswfWhite);
  751. Strel := Movie.AddLine(0, 0, 0, 15);
  752. Strel.SetLineStyle(2, cswfBlack);
  753. SprStrel := movie.AddSprite;
  754. SprStrel.PlaceObject(WhiteRect, 1);
  755. SprStrel.PlaceObject(Strel, 2);
  756. SprStrel.ShowFrame(CalcFrame(0.4));
  757. SprStrel.RemoveObject(2);
  758. SprStrel.ShowFrame(CalcFrame(0.4));
  759.  
  760. for il := 0 to length(Txt1.Text) do
  761. with Movie.PlaceObject(SprStrel, 103) do
  762. begin
  763. SetTranslate(16 + Round(il*8.4), 45);
  764. Movie.ShowFrame(CalcFrame(0.15));
  765. if il = 0 then Movie.ShowFrame(CalcFrame(1.45))
  766. else RemoveDepth := true;
  767. end;
  768.  
  769. Movie.ShowFrame(CalcFrame(0.5));
  770.  
  771. Txt1 := Movie.AddText('is created by', SWFRGBA(clBlack), fntCourier, Point(8, 65));
  772. Movie.PlaceObject(Txt1, 100);
  773. for il := 0 to length(Txt1.Text) do
  774. with Movie.PlaceObject(SprStrel, 103) do
  775. begin
  776. SetTranslate(8 + Round(il*8.4), 65);
  777. Movie.ShowFrame(CalcFrame(0.15));
  778. if il = 0 then Movie.ShowFrame(CalcFrame(1));
  779. RemoveDepth := true;
  780. end;
  781. Movie.ShowFrame(CalcFrame(0.5));
  782.  
  783.  
  784. Txt1 := Movie.AddText('Delphi SWF SDK', SWFRGBA(clRed), fntCourier, Point(3, 85));
  785. Movie.PlaceObject(Txt1, 101);
  786.  
  787. for il := 0 to length(Txt1.Text) do
  788. with Movie.PlaceObject(SprStrel, 103) do
  789. begin
  790. SetTranslate(3 + Round(il*8.4), 85);
  791. Movie.ShowFrame(CalcFrame(0.15));
  792. if il = 0 then Movie.ShowFrame(CalcFrame(1));
  793. RemoveDepth := true;
  794. end;
  795.  
  796. Movie.ShowFrame(CalcFrame(0.5));
  797. Movie.RemoveObject(103);
  798. Movie.ShowFrame(CalcFrame(0.5));
  799.  
  800. FadeOut;
  801.  
  802. Movie.RemoveObject(99);
  803. Movie.RemoveObject(100);
  804. Movie.RemoveObject(101);
  805.  
  806. // ========================= Scene 2 ======================================
  807.  
  808. imgD := Movie.AddImage;
  809. imgD.LoadDataFromHandle(vclD.Picture.Bitmap.Handle);
  810.  
  811. rImageD :=Movie.AddShapeImage(imgD);
  812. Movie.PlaceObject(rImageD, 1).SetTranslate(41, 20);
  813. Txt1 := Movie.AddText('Delphi', SWFRGBA(51, 51, 153, 255), fntDinCond, Point(20, 90));
  814. Movie.PlaceObject(Txt1, 10);
  815.  
  816. FadeIn;
  817. Movie.ShowFrame(CalcFrame(0.5));
  818. FadeOut;
  819.  
  820. Movie.RemoveObject(1);
  821. Movie.RemoveObject(10);
  822. // ========================= Scene 3 ======================================
  823.  
  824. Txt1 := Movie.AddText('+', SWFRGBA(51, 51, 153, 255), fntDinCond, Point(55, 50));
  825. Movie.PlaceObject(Txt1, 10);
  826. FadeIn;
  827. Movie.ShowFrame(CalcFrame(0.2));
  828. FadeOut;
  829. Movie.RemoveObject(10);
  830. // ========================= Scene 4 ======================================
  831.  
  832. imgF := Movie.AddImage;
  833. imgF.LoadDataFromHandle(vclF.Picture.Bitmap.Handle);
  834.  
  835. rImageF :=Movie.AddShapeImage(imgF);
  836. Movie.PlaceObject(rImageF, 1).SetTranslate(39, 30);
  837. Txt1 := Movie.AddText('Flash', SWFRGBA(51, 51, 153, 255), fntDinCond, Point(28, 90));
  838. Movie.PlaceObject(Txt1, 10);
  839.  
  840. FadeIn;
  841. Movie.ShowFrame(CalcFrame(0.5));
  842. FadeOut;
  843.  
  844. Movie.RemoveObject(1);
  845. Movie.RemoveObject(10);
  846.  
  847. // ========================= Scene 5 ======================================
  848.  
  849. Txt1 := Movie.AddText('et crossroad', SWFRGBA(51, 51, 153, 255), fntDinCond, Point(0, 0));
  850. With Movie.PlaceObject(Txt1, 1) do
  851. begin
  852. SetScale(0.5, 0.5);
  853. SetTranslate(20, 45);
  854. end;
  855. Txt1 := Movie.AddText('two technologies', SWFRGBA(51, 51, 153, 255), fntDinCond, Point(0, 0));
  856. With Movie.PlaceObject(Txt1, 10) do
  857. begin
  858. SetScale(0.5, 0.5);
  859. SetTranslate(5, 75);
  860. end;
  861. FadeIn;
  862. Movie.ShowFrame(CalcFrame(2));
  863. FadeOut;
  864. Movie.RemoveObject(1);
  865. Movie.RemoveObject(10);
  866.  
  867. // ========================= TotalMC ======================================
  868.  
  869. TotalMC := Movie.AddSprite;
  870.  
  871. Ballon := Movie.AddCircle(0, 0, 5);
  872. Ballon.SetRadialGradient(SWFRGBA($FF, $FF, $DD, $FF), SWFRGBA(clNavy), 35, 35);
  873. TotalMC.PlaceObject(Ballon, 30).SetTranslate(20, 11);
  874. TotalMC.PlaceObject(Ballon, 31).SetTranslate(165, 11);
  875. TotalMC.PlaceObject(Ballon, 9).SetTranslate(92, 53);
  876.  
  877. Txt1 := Movie.AddText('Delphi + Flash', SWFRGBA(51, 51, 153, 255), fntDinCond, Point(0, 0));
  878. With TotalMC.PlaceObject(Txt1, 20) do
  879. begin
  880. SetPosition(35, -2);
  881. SetScale(0.55, 0.55);
  882. end;
  883. With TotalMC.PlaceObject(Txt1, 19) do
  884. begin
  885. SetPosition(37, -1);
  886. SetScale(0.55, 0.55);
  887. ColorTransform.addR := $FF;
  888. ColorTransform.addG := $FF;
  889. ColorTransform.addB := $FF;
  890. end;
  891. With TotalMC.PlaceObject(Txt1, 18) do
  892. begin
  893. SetPosition(34, -1);
  894. SetScale(0.55, 0.55);
  895. ColorTransform.addR := $FF;
  896. ColorTransform.addG := $FF;
  897. ColorTransform.addB := $FF;
  898. end;
  899.  
  900. Txt1 := Movie.AddText('Delphi SWF SDK', cswfRed, fntDinCond, Point(0, 0));
  901. With TotalMC.PlaceObject(Txt1, 17) do
  902. begin
  903. SetPosition(32, 57);
  904. SetScale(0.55, 0.55);
  905. end;
  906.  
  907. TotalMC.FrameActions.Stop;
  908. TotalMC.ShowFrame;
  909.  
  910. SprStrel := Movie.AddSprite;
  911. For il := 1 to CalcFrame(1) do
  912. begin
  913. RR1 := Movie.AddArc(0, 0, 61, - 45, il / CalcFrame(1) * 360 - 45, false);
  914. RR1.SetLineStyle(1, SWFRGBA(clNavy));
  915. with SprStrel.PlaceObject(RR1, 1) do
  916. begin
  917. SetScale(1, 0.2);
  918. SetSkew(0, - 0.34);
  919. if il > 1 then RemoveDepth := true;
  920. end;
  921.  
  922. if il = CalcFrame(1) then
  923. With SprStrel.FrameActions do
  924. begin
  925. Stop;
  926. SetTarget('_parent');
  927. Play;
  928. end;
  929. SprStrel.ShowFrame;
  930. end;
  931. TotalMC.PlaceObject(SprStrel, 3).SetTranslate(125, 33);
  932. With TotalMC.PlaceObject(SprStrel, 4) do
  933. begin
  934. SetTranslate(60, 33);
  935. SetScale(-1, 1);
  936. end;
  937. TotalMC.FrameActions.Stop;
  938. TotalMC.ShowFrame;
  939.  
  940. RR2 := Movie.AddStar(0, 0 , 25, -15, 10);
  941. RR2.SetRadialGradient(SWFRGBA($FF, $80, $00, $FF), SWFRGBA($FA, $FA, $FA, $FA), 50, 50);
  942. with TotalMC.PlaceObject(RR2, 10) do
  943. begin
  944. SetTranslate(92, 53);
  945. SetScale(0.5, 0.7);
  946. end;
  947. TotalMC.ShowFrame;
  948.  
  949. with TotalMC.PlaceObject(RR2, 10) do
  950. begin
  951. SetTranslate(92, 53);
  952. SetScale(1.1, 0.8);
  953. RemoveDepth := true;
  954. end;
  955. TotalMC.ShowFrame;
  956.  
  957. with TotalMC.PlaceObject(RR2, 10) do
  958. begin
  959. SetTranslate(92, 53);
  960. SetScale(1.1, 1.2);
  961. ColorTransform.addA := - 60;
  962. RemoveDepth := true;
  963. end;
  964.  
  965. TotalMC.ShowFrame;
  966.  
  967. with TotalMC.PlaceObject(RR2, 10) do
  968. begin
  969. SetTranslate(92, 53);
  970. SetScale(1.1, 1.2);
  971. ColorTransform.addA := - 180;
  972. RemoveDepth := true;
  973. end;
  974.  
  975. TotalMC.RemoveObject(10);
  976.  
  977. TotalMC.ShowFrame(CalcFrame(0.5));
  978. with TotalMC.FrameActions do
  979. begin
  980. Stop;
  981. SetTarget('_root');
  982. Play;
  983. SetTarget('');
  984. end;
  985. TotalMC.ShowFrame;
  986.  
  987. SprStrel := Movie.AddSprite;
  988. For il := 1 to CalcFrame(1) do
  989. begin
  990. RR1 := Movie.AddArc(0, 0, 61, il/ CalcFrame(1) * 360, (il + 0.5) / CalcFrame(1) * 360, false);
  991. RR1.SetLineStyle(3, SWFRGBA(255, 196, 69, $EE));
  992. with SprStrel.PlaceObject(RR1, 1) do
  993. begin
  994. SetScale(1, 0.2);
  995. SetSkew(0, - 0.34);
  996. if il > 1 then RemoveDepth := true;
  997. end;
  998. SprStrel.ShowFrame;
  999. end;
  1000. TotalMC.PlaceObject(SprStrel, 5).SetTranslate(125, 33);
  1001.  
  1002. With TotalMC.PlaceObject(SprStrel, 7) do
  1003. begin
  1004. SetTranslate(60, 33);
  1005. SetScale(-1, 1);
  1006. Name := 'd1';
  1007. end;
  1008.  
  1009. With TotalMC.FrameActions do
  1010. begin
  1011. Stop;
  1012. SetTarget('d1');
  1013. GotoAndPlay(CalcFrame(0.5));
  1014. end;
  1015. TotalMC.ShowFrame;
  1016.  
  1017. with Movie.PlaceObject(TotalMC, 2) do
  1018. begin
  1019. Name := 'total';
  1020. SetTranslate(7, 55);
  1021. SetScale(0.6, 0.6);
  1022. end;
  1023.  
  1024. FadeIn;
  1025. Movie.ShowFrame(CalcFrame(0.5));
  1026.  
  1027. with Movie.FrameActions do
  1028. begin
  1029. Stop;
  1030. SetTarget('total');
  1031. Play;
  1032. end;
  1033. Movie.ShowFrame;
  1034.  
  1035.  
  1036. // ==================================== Button 'See source' ==================================
  1037. RR1 := Movie.AddRoundRect(Rect(0, 0, 80, 20), 4);
  1038. RR1.SetLineStyle(1, cswfGray70);
  1039. RR1.SetSolidColor(cswfWhite);
  1040.  
  1041. RR2 := Movie.AddRoundRect(Rect(2, 2, 78, 18), 2);
  1042. RR2.SetLineStyle(1, cswfGray30);
  1043. RR2.SetSolidColor(SWFRGBA(240, 240, 240, 255));
  1044.  
  1045. Strel := Movie.AddShape;
  1046. Strel.SetShapeBound(-4, -2, 4, 4);
  1047. Strel.SetLineStyle(1, cswfGray80);
  1048. With Strel.Edges do
  1049. begin
  1050. MoveTo(-3, -4);
  1051. LineTo(0, 0);
  1052. LineTo(-3, 4);
  1053. MoveTo(0, -4);
  1054. LineTo(3, 0);
  1055. LineTo(0, 4)
  1056. end;
  1057.  
  1058. SprStrel := Movie.AddSprite;
  1059. for il := 1 to CalcFrame(0.5) do
  1060. with SprStrel.PlaceObject(Strel, 1) do
  1061. begin
  1062. SetTranslate(70, 11);
  1063. ColorTransform.addA := - il * 20;
  1064. if il > 1 then RemoveDepth := true;
  1065. SprStrel.ShowFrame;
  1066. end;
  1067. for il := CalcFrame(0.5) downto 1 do
  1068. with SprStrel.PlaceObject(Strel, 1) do
  1069. begin
  1070. SetTranslate(70, 11);
  1071. ColorTransform.addA := - il * 20;
  1072. RemoveDepth := true;
  1073. SprStrel.ShowFrame;
  1074. end;
  1075.  
  1076. Txt1 := Movie.AddText('See source', cswfGray80, fntTahoma, Point(7, 3));
  1077.  
  1078. ButEdg := Movie.AddSprite;
  1079. ButEdg.PlaceObject(RR1, 1);
  1080. ButEdg.PlaceObject(RR2, 2);
  1081.  
  1082. SprButton1 := Movie.AddSprite;
  1083. SprButton1.PlaceObject(ButEdg, 1);
  1084. SprButton1.PlaceObject(Txt1, 3);
  1085. SprButton1.PlaceObject(SprStrel, 4);
  1086. SprButton1.ShowFrame;
  1087.  
  1088. SprButton2 := Movie.AddSprite;
  1089. SprButton2.PlaceObject(ButEdg, 1);
  1090. SprButton2.PlaceObject(Txt1, 3).SetTranslate(1, 1);
  1091. SprButton2.PlaceObject(SprStrel, 4).SetTranslate(1, 1);
  1092. SprButton2.ShowFrame;
  1093.  
  1094. ButSee := Movie.AddButton;
  1095. ButSee.AddRecord(RR1, [bsHitTest]);
  1096. with ButSee.AddRecord(SprButton1, [bsUp]).ColorTransform do
  1097. begin
  1098. addB := 70;
  1099. addA := -50;
  1100. end;
  1101. with ButSee.AddRecord(SprButton1, [bsOver]).ColorTransform do
  1102. begin
  1103. addR := 90;
  1104. addG := 30;
  1105. addB := -20;
  1106. end;
  1107. ButSee.AddRecord(SprButton2, [bsDown]).ColorTransform.addB := 70;
  1108.  
  1109. ButSee.OnClickActions.GetUrl('http://www.torry.net/cgi-bin/banners.fpl?region=34&campaign=266&banner=245&mode=CLICK', '_blank');
  1110.  
  1111. //================================ Rolled text =======================================
  1112. RR2 := Movie.AddRectangle(0, 0, 125, 10);
  1113. RR2.SetLinearGradient(SWFRGBA(255,255,255,0), cswfWhite, 90);
  1114.  
  1115. txt2 := Movie.AddText('- visual objects:<br> shape, button, sprite,<br> morphing shape, text<br>'+
  1116. '- all types of filling:<br> solid, gradient, image<br>'+
  1117. '- device and<br> embedding fonts<br>'+
  1118. '- sound:<br> events, streaming<br>'+
  1119. '- video<br>'+
  1120. '- action commands<br>'+
  1121. '- any transition and<br> transformation<br> etc.',
  1122. SWFRGBA(clNavy), fntTahoma, Rect(1, 135, 125, 200));
  1123. txt2.NoSelect := true;
  1124. txt2.HTML := true;
  1125. txt2.UseOutlines := true;
  1126. txt2.AutoSize := true;
  1127. txt2.WordWrap := true;
  1128.  
  1129. SprStrel := Movie.AddSprite;
  1130. With SprStrel.PlaceObject(WhiteRect, 2) do
  1131. begin
  1132. SetScale(1, 2.3);
  1133. end;
  1134.  
  1135. SprStrel.PlaceObject(txt2, 1).Name := 'roll';
  1136. SprStrel.PlaceObject(RR2, 10).SetTranslate(0, 50);
  1137. With SprStrel.PlaceObject(RR2, 11) do
  1138. begin
  1139. SetScale(1, -1);
  1140. SetTranslate(0, 135);
  1141. end;
  1142. with SprStrel.PlaceObject(WhiteRect, 12) do
  1143. begin
  1144. SetTranslate(0, 135);
  1145. SetScale(1, 2);
  1146. end;
  1147. SprStrel.ShowFrame;
  1148.  
  1149. // ==================================== Last scene ==================================
  1150.  
  1151. MTime := 0.7;
  1152. FrCount := CalcFrame(MTime);
  1153.  
  1154. for il := 0 to FrCount do
  1155. begin
  1156. with Movie.PlaceObject(2) do
  1157. begin
  1158. SetTranslate(7, 55 - Round( 55 * (Ease(3, (FrCount - il)/ FrCount, true))));
  1159. SetScale(0.6, 0.6);
  1160. RemoveDepth := true;
  1161. end;
  1162.  
  1163. With Movie.PlaceObject(ButSee, 50) do
  1164. begin
  1165. SetTranslate( 125 - Round(100 * (il)/ FrCount), 137);
  1166. if il > 0 then RemoveDepth := true;
  1167. end;
  1168.  
  1169. Movie.ShowFrame;
  1170. end;
  1171.  
  1172. With Movie.PlaceObject(SprStrel, 1).OnEnterFrame do
  1173. begin
  1174. ConstantPool(['roll', 'il']);
  1175. Push([0, fpPosY, 0, fpPosY], [vtConstant8, vtInteger, vtConstant8, vtInteger]);
  1176. GetProperty;
  1177. Push([0, fpHeight], [vtConstant8, vtInteger]);
  1178. GetProperty;
  1179. Add2; // roll._y + roll._height
  1180. Push(60);
  1181. Less;
  1182. label1 := _If.BranchOffsetMarker;
  1183. Push([0, fpPosY], [vtConstant8, vtInteger]);
  1184. GetProperty;
  1185. Push(-0.5);
  1186. Add;
  1187. SetProperty;
  1188. label2 := Jump.BranchOffsetMarker;
  1189. SetMarker(label1);
  1190. Push(135);
  1191. SetProperty;
  1192. PushConstant([1, 1, 1]);
  1193. GetVariable;
  1194. Increment;
  1195. SetVariable;
  1196. GetVariable;
  1197. Push(2);
  1198. Equals2;
  1199. _Not;
  1200. label1 := _If.BranchOffsetMarker;
  1201. Stop;
  1202. SetTarget('_root');
  1203. Play;
  1204. SetMarker(label1);
  1205. SetMarker(label2);
  1206. end;
  1207.  
  1208. with Movie.FrameActions do
  1209. begin
  1210. Stop;
  1211. SetTarget('total');
  1212. Play;
  1213. end;
  1214. Movie.ShowFrame;
  1215. FadeOut;
  1216.  
  1217. Movie.MakeStream;
  1218. Movie.SaveToFile(SD.FileName);
  1219. Movie.Free;
  1220.  
  1221. ShellExecute(handle, PChar('open'), PChar(SD.FileName), nil, nil, sw_Normal);
  1222. end;
  1223.  
  1224. end.
  1225.  

Copyright 2004-2009 FeatherySoft, Inc. All rights reserved
Delphi is a trademark of Borland Software Corporation
Macromedia and Shockwave Flash are registered trademarks of Adobe Systems Incorporated.