[Component] Using Shockwave Flash ActiveX in RichView
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
[Component] Using Shockwave Flash ActiveX in RichView
Using Shockwave Flash ActiveX in RichView.
You can play SWF movies just in RichView documents, save/load them in RVF, export to HTML.
Download
http://www.trichview.com/support/files/rvswf.zip
and read readme.txt
You can play SWF movies just in RichView documents, save/load them in RVF, export to HTML.
Download
http://www.trichview.com/support/files/rvswf.zip
and read readme.txt
Using Shockwave Flash ActiveX in RichView (C++) ??
Dear Sergey,
Do you have a sample in C++ for 'Using Shockwave Flash ActiveX in RichView'
Thanks.
Pieter E.
Do you have a sample in C++ for 'Using Shockwave Flash ActiveX in RichView'
Thanks.
Pieter E.
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
It's rather old, but I think it's up to date.
About C++Builder.
I believe the only way to use it in C++Builder is to rewrite it completely in C++. It's because this component uses DCU file generated on the ActiveX import, but C++Builder does not generate it.
I tried to create a component for C++Builder, but it does not work for some reason.
I uploaded it to http://www.trichview.com/support/files/ ... ashCPP.zip
Install "ShockwaveFlash" control (C++Builder will create ShockwaveFlashObjects_OCX cpp and h), then install this file.
2 new components will be installed:
TMyShockwaveFlash (the component translated from pascal)
TMyShockwaveFlashTest (test, the component inherited from TShockwaveFlash without new methods, fields and properties).
I tried to place TMyShockwaveFlash* swf on form and to call
swf->LoadFlash("somefile.swf");
swf->InitFlash();
swf->Play();
The program is crashed inside InitFlash(), on the line
Movie = FTmpFileName;
I tried to assign it simply as
swf->Movie = "somefile.swf";
but it crashed again. Movie is inherited from TShockwaveFlash, I did not modify it.
At the same time, assigning Movie of TMyShockwaveFlashTest works properly.
May be C++Builder experts can help here.
About C++Builder.
I believe the only way to use it in C++Builder is to rewrite it completely in C++. It's because this component uses DCU file generated on the ActiveX import, but C++Builder does not generate it.
I tried to create a component for C++Builder, but it does not work for some reason.
I uploaded it to http://www.trichview.com/support/files/ ... ashCPP.zip
Install "ShockwaveFlash" control (C++Builder will create ShockwaveFlashObjects_OCX cpp and h), then install this file.
2 new components will be installed:
TMyShockwaveFlash (the component translated from pascal)
TMyShockwaveFlashTest (test, the component inherited from TShockwaveFlash without new methods, fields and properties).
I tried to place TMyShockwaveFlash* swf on form and to call
swf->LoadFlash("somefile.swf");
swf->InitFlash();
swf->Play();
The program is crashed inside InitFlash(), on the line
Movie = FTmpFileName;
I tried to assign it simply as
swf->Movie = "somefile.swf";
but it crashed again. Movie is inherited from TShockwaveFlash, I did not modify it.
At the same time, assigning Movie of TMyShockwaveFlashTest works properly.
May be C++Builder experts can help here.
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Info about flash movie size:
http://www.trichview.com/forums/viewtopic.php?t=234
http://www.trichview.com/forums/viewtopic.php?t=234
Dear Sergey,
I've tried the sourcecode for handling TMyShockwaveFlash in C++ without any success. I'd like to try it using another method. I found a way to handle TShockwaveFlash, TMediaPlayer and QuickTime without errors in TRichViewEdit. (Drag&Drop, Stretching, Resizing, Playing, Stopping, etc). Still I can't figure out how to save the files to RVF.
Is it possible to create a stream from a file and save it to RVF? If so, should I use OnSaveComponentToFile or OnSaveItemToFile?
Could you please inform me?
Thanks,
Pieter E.
I've tried the sourcecode for handling TMyShockwaveFlash in C++ without any success. I'd like to try it using another method. I found a way to handle TShockwaveFlash, TMediaPlayer and QuickTime without errors in TRichViewEdit. (Drag&Drop, Stretching, Resizing, Playing, Stopping, etc). Still I can't figure out how to save the files to RVF.
Is it possible to create a stream from a file and save it to RVF? If so, should I use OnSaveComponentToFile or OnSaveItemToFile?
Could you please inform me?
Thanks,
Pieter E.
There is a good and bad side of TMyShockwaveFlash. If the swf reads other files, example text, the flash in rve will be blank. This is because rve is reading the swf directly into the memory without considering the other file that the swf is dependng. There are other methods that can be used for loading swf even with TMyShockwaveFlash but they must be used carefully.
What do you mean by saving the files to RVF? The swf?
What do you mean by saving the files to RVF? The swf?
I would advice against doing that because it will slow down the process of RichView reading the file. You can, on the other hand, save the swf file into the same directory as your rvf, which is simpler to do. swf is not component and so it cannot be included in the rvf file without altering richview source code. I have tried that and I found it was just too slow. Perhaps there is another way that I did no see.
Good luck.
Good luck.
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Components are saved in RVF files together with all their published properties. Well, a flash movie or another binary data cannot be a real published property, but they can be saved and loaded in a fake property defined in the component's DefineProperties method (it must be overriden in your component). In this method, call Filer.DefineBinaryProperty method specifiyng your component's methods for reading and writing this property. A good example can be found in this TMyShockwaveFlash component: a flash file is saved in 'FlashMovie' fake property.
So, if you want to save some file with your component, do it as it was implemented in TMyShockwaveFlash.
So, if you want to save some file with your component, do it as it was implemented in TMyShockwaveFlash.
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Hi Sergey,
Can't I cheat a bit by assigning swf.Movie := ... instead?
The swf.LoadFlash will load the flash but without any supporting files. Say there is a text box in the swf and the text should be read while the swf file is placed in RichView, but the text is never read nor displayed in the swf text-box. It is always empty. The swf.InitFlash does not allow the reading of the text through a stream. Is there any other method to allow the swf to read its own assigned files?
Unless there is a command for reading the text after or just before the AddControlEx..., LoadFlash does not allow the swf to read supporting files.
Any suggestion here?
Henry
Can't I cheat a bit by assigning swf.Movie := ... instead?
The swf.LoadFlash will load the flash but without any supporting files. Say there is a text box in the swf and the text should be read while the swf file is placed in RichView, but the text is never read nor displayed in the swf text-box. It is always empty. The swf.InitFlash does not allow the reading of the text through a stream. Is there any other method to allow the swf to read its own assigned files?
Unless there is a command for reading the text after or just before the AddControlEx..., LoadFlash does not allow the swf to read supporting files.
Any suggestion here?
Henry
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Yes, this component assumes that flash movies do not require additional data, or they know from where to get them regardless of the movie location.
LoadFlash loads the movie into the internal stream (which can be saved in RVF file). When playing (InitFlash), it creates a temporal flash file in temporal directory, and plays it.
If you need to play a file from the specific location instead of stream, of course, use standard TShockwaveFlash.
LoadFlash loads the movie into the internal stream (which can be saved in RVF file). When playing (InitFlash), it creates a temporal flash file in temporal directory, and plays it.
If you need to play a file from the specific location instead of stream, of course, use standard TShockwaveFlash.