{"id":791,"date":"2008-05-27T12:22:13","date_gmt":"2008-05-27T12:22:13","guid":{"rendered":"http:\/\/6teen.ru\/?p=655"},"modified":"2008-05-27T12:22:13","modified_gmt":"2008-05-27T12:22:13","slug":"9949","status":"publish","type":"post","link":"http:\/\/pblog.ru\/lab\/?p=791","title":{"rendered":"\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Flash"},"content":{"rendered":"<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Flash<br \/>\n<!--more--><\/p>\n<pre class=\"alt2\" style=\"margin:0px; padding:6px; border:1px inset; width:580px; height:320px; overflow:auto\"><div>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Flash\n\nHow to play flash movie inside applications\n\nActiveX ShockwaveFlash plays flash movies, it is in the library flash.ocx of Macromedia, Inc. (earlier versions were called swflash.ocx). So the first requirement is this library must be installed. As a rule, it is in the folder [Win_system]\\Macromed\\Flash\\, for example C:\\Windows\\system32\\Macromed\\Flash\\. If not you should install the one before starting of application.\n\nAlso, you should use ActiveX component TShockwaveFlash in your application. It contains as property Movie so other various methods to manage movie playing - Play, Stop, Rewind etc.\nSome examples of ActiveX using are at the Using TShockwaveFlash part.\n\nHow to install Flash.ocx into system\n\nMacromedia provides the on-line installing of player at its web-site. So you can install the newest version of the player free clicking this link. Once everyone, surfing Internet, opens site with Flash and if the Flash player has not been installed yet, the browser offers to do that, so it is very probable that the Flash players are on almost all computers connected to Internet.\n\nIf the application must be installed there are some tips how to do that.\nIt is better to set the one during your application installing for the flash.ocx library would be available for other applications. Almost all software for installation making can do that: InstallShield, InstallWizard, InnoSetup, GhostInastall etc.\nYour program can do that too: copy flash.ocx to the system folder or the application folder and register it.\n\n{Register the OCX File}\n\/\/ set LibraryDir\n\/\/ LibraryDir := ExtractFilePath(Application.ExeName);\n\/\/ or\n\/\/ LibraryDir := SystemDir;\n\naHandle := LoadLibrary(PChar(LibraryDir + 'flash.ocx'));\nif ( aHandle >= 32 ) then\nbegin\n aFunc := GetProcAddress( aHandle, 'DllRegisterServer' );\n if Assigned( aFunc ) then\n  begin\n   GetShortPathName( PChar(LibraryDir + 'flash.ocx'), aShortPath, sizeOf(aShortPath));\n   aCommand := Format( '%s\\regsvr32.exe \/s %s', [SystemDir, aShortPath] );\n   WinExecAndWait32( aCommand, SW_HIDE );\n  end;\n FreeLibrary( aHandle );\nend;\n\nHow to install Flash.ocx into Delphi IDE\n\nIn Delphi click the menu Component -> Import ActiveX Control... Choose \"Shockwave Flash\" from the list of available objects or brows the file Flash.ocx and import it.\n\nThe TShockwaveFlash component will appear in the ActiveX tab.\n\nYou can use Delphi package prepared by us. You should do the following:\nOpen project > choose FlashAX.dpk > Install. The TShockwaveFlash and TShockwaveFlashEx components will appear in the ActiveX tab. TShockwaveFlashEx is an advanced component, learn more...\n\nSimple playing\n\nFor example, there is a task to play sample.swf which is in the same folder that the application is. Put the TShockwaveFlash component to the form and rename the one into FlashPlayer. Then:\n\nprocedure TmDemo.FormCreate(Sender: TObject);\nbegin\n  FlashPlayer.Movie := ExtractFilePath(Application.ExeName) + 'sample.swf';\n  labelInfo.Caption := Format('%d frames', FlashPlayer.TotalFrames);\n  FlashPlayer.Play;\nend;\n\nprocedure TmDemo.bStopClick(Sender: TObject);\nbegin\n FlashPlayer.Stop;\nend;\n\nprocedure TmDemo.bPlayClick(Sender: TObject);\nbegin\n  FlashPlayer.Play;\nend;\n<\/div><\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Flash<\/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],"_links":{"self":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/791"}],"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=791"}],"version-history":[{"count":0,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/791\/revisions"}],"wp:attachment":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=791"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}