{"id":719,"date":"2008-05-23T04:08:22","date_gmt":"2008-05-23T04:08:22","guid":{"rendered":"http:\/\/6teen.ru\/?p=644"},"modified":"2008-05-23T04:08:22","modified_gmt":"2008-05-23T04:08:22","slug":"807","status":"publish","type":"post","link":"http:\/\/pblog.ru\/lab\/?p=719","title":{"rendered":"\u041f\u0440\u043e\u0438\u0433\u0440\u0430\u0442\u044c Flash \u0444\u0430\u0439\u043b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438"},"content":{"rendered":"<p>\u041f\u0440\u043e\u0438\u0433\u0440\u0430\u0442\u044c Flash \u0444\u0430\u0439\u043b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<br \/>\n<!--more--><\/p>\n<pre class=\"alt2\" style=\"margin:0px; padding:6px; border:1px inset; width:580px; height:320px; overflow:auto\"><div>\u041f\u0440\u043e\u0438\u0433\u0440\u0430\u0442\u044c Flash \u0444\u0430\u0439\u043b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438\n\nTo make use of SWF files in your Delphi application you should have the swf plugin installed then follow these steps:\n\n{English}\n\nIn the Delphi IDE\n\n- click on \"Component\", \"Import ActiveX Control\"\n- chose \"Shockwave Flash\" and click on \"install\".\n\nNow you have a TShockwaveFlash component in your IDE on the ActiveX tabsheet. Place the TShockwaveFlash Component onto your form, resize it as needed but for now do not assign a movie to it.\n\nYou will need to register the ocx file if it is not installed on the target computer. So you should have a resource file with\n\n- the swflash.ocx and your Flash ( *.swf) file.\n- Copy swflash.ocx (from i.e. windows\\system32\\macromed\\flash) and your custom swf file to your project path.\n- Create a textfile with a code like this:\n\nSHOCKWAVEFILE RCDATA yourfile.swf\nSHOCKWAVEOCX RCDATA swflash.ocx\n\n(Where yourfile.swf is your swf-file)\n\n- Save this file as flash.rc\n- Goto Commandline, change to your project dir and enter the line:\n\n\"Brcc32 -r flash.rc\"\n\n- Now you have your new resource as flash.res file\nuses\n  ShockwaveFlashObjects_TLB; \/\/ will be used automatically\n\nimplementation\n\n{$R *.DFM}\n{$R flash.res} \/\/ your new created resource\n{...}\n\nprocedure TForm1.FormCreate(Sender: TObject);\nvar\n  SystemDir: array[0..MAX_PATH] of Char;\n  SWFDir, AppDir: string;\n  Fres: TResourceStream;\n  Ffile: TFileStream;\nbegin\n  GetSystemDirectory(@SystemDir, MAX_PATH);\n  SWFDir := SystemDir + '\\macromed\\flash\\';\n  GetDir(0, AppDir); \/\/ Get current directory\n\n  \/\/check whether the sw-flash ocx is already installed\n  if FileExists(SWFDir + 'swflash.ocx') = False then\n  begin\n    \/\/create directories if needed and extract file from resource.\n    {$i-} \/\/compiler directive to suppress i\/o error messages\n    MkDir(SystemDir + '\\macromed');\n    MKDir(SystemDir + '\\macromed\\flash');\n    {$i+}\n    Fres := TResourceStream.Create(0, 'SHOCKWAVEOCX', RT_RCDATA);\n    Ffile := TFileStream.Create(SWFDir + 'swflash.ocx', fmCreate);\n    Ffile.CopyFrom(Fres, Fres.Size);\n    Fres.Free;\n    Ffile.Free;\n\n    \/\/register ocx (simple but useful)\n    WinExec(PChar('regsvr32 \/s ' + SWFDir + 'swflash.ocx'), SW_HIDE);\n  end;\n  \/\/ extract ShockwaveFile from resource to application directory\n  Fres := TResourceStream.Create(0, 'SHOCKWAVEFILE', RT_RCDATA);\n  Ffile := TFileStream.Create('flashmovie.swf', fmCreate);\n  Ffile.CopyFrom(Fres, Fres.Size);\n  Fres.Free;\n  Ffile.Free;\n\n  \/\/Assign the extracted swf file to your TShockwaveFlash object\n  FlashMovie.Movie := AppDir + '\\flashmovie.swf';\nend;\n\n(*\n  If you dont want to have the popup menu displayed on right click\n  you may chose menu property of TShockWave to false.\n*)\n<\/div><\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u043e\u0438\u0433\u0440\u0430\u0442\u044c Flash \u0444\u0430\u0439\u043b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[448,454],"tags":[528,930,1634,1029],"_links":{"self":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/719"}],"collection":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=719"}],"version-history":[{"count":0,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/719\/revisions"}],"wp:attachment":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=719"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}