| View previous topic :: View next topic |
| Author |
Message |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
Posted: Wed Sep 07, 2005 11:19 am Post subject: [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 |
|
| Back to top |
|
 |
shmp
Joined: 28 Aug 2005 Posts: 140 Location: Sabah, Malaysia.
|
Posted: Wed Sep 07, 2005 11:36 pm Post subject: |
|
|
| Sergey, is this a latest demo? |
|
| Back to top |
|
 |
Pieter E.
Joined: 28 Aug 2005 Posts: 339
|
Posted: Thu Sep 08, 2005 6:44 am Post subject: 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. |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
Posted: Fri Sep 09, 2005 5:15 pm Post subject: |
|
|
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/MyShockwaveFlashCPP.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. |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
|
| Back to top |
|
 |
Pieter E.
Joined: 28 Aug 2005 Posts: 339
|
Posted: Wed Dec 21, 2005 10:20 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
shmp
Joined: 28 Aug 2005 Posts: 140 Location: Sabah, Malaysia.
|
Posted: Thu Dec 22, 2005 1:09 pm Post subject: |
|
|
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?  |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Dec 22, 2005 1:15 pm Post subject: |
|
|
| @shmp: I'd like to save the SWF (flash file) in the RVF (RichView file). It would be perfect for my application. Because it only handles RichView documents. I hope it isn't bad for the performance of my application. |
|
| Back to top |
|
 |
Pieter E.
Joined: 28 Aug 2005 Posts: 339
|
Posted: Thu Dec 22, 2005 1:19 pm Post subject: |
|
|
Sorry, I'm the 'Guest' this time. (I didn't login) |
|
| Back to top |
|
 |
shmp
Joined: 28 Aug 2005 Posts: 140 Location: Sabah, Malaysia.
|
Posted: Thu Dec 22, 2005 1:49 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
Posted: Thu Dec 22, 2005 5:06 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
Posted: Thu Dec 22, 2005 5:07 pm Post subject: |
|
|
| shmp, in TMyShockwaveFlash, a new movie must be loaded using LoadFlash method. |
|
| Back to top |
|
 |
shmp
Joined: 28 Aug 2005 Posts: 140 Location: Sabah, Malaysia.
|
Posted: Fri Dec 23, 2005 12:56 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
shmp
Joined: 28 Aug 2005 Posts: 140 Location: Sabah, Malaysia.
|
Posted: Fri Dec 23, 2005 1:04 am Post subject: |
|
|
Or most likely, swf do not know where the text filles are since it is working through a stream?
Henry. |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
Posted: Fri Dec 23, 2005 11:08 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
|