Page 1 of 2

[Component] Using Shockwave Flash ActiveX in RichView

Posted: Wed Sep 07, 2005 11:19 am
by Sergey Tkachenko
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

Posted: Wed Sep 07, 2005 11:36 pm
by shmp
Sergey, is this a latest demo?

Using Shockwave Flash ActiveX in RichView (C++) ??

Posted: Thu Sep 08, 2005 6:44 am
by Pieter E.
Dear Sergey,

Do you have a sample in C++ for 'Using Shockwave Flash ActiveX in RichView'

Thanks.

Pieter E.

Posted: Fri Sep 09, 2005 5:15 pm
by Sergey Tkachenko
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.

Posted: Sat Oct 15, 2005 8:32 am
by Sergey Tkachenko

Posted: Wed Dec 21, 2005 10:20 am
by Pieter E.
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.

Posted: Thu Dec 22, 2005 1:09 pm
by shmp
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? :shock:

Posted: Thu Dec 22, 2005 1:15 pm
by Guest
@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.

Posted: Thu Dec 22, 2005 1:19 pm
by Pieter E.
Sorry, I'm the 'Guest' this time. :D (I didn't login)

Posted: Thu Dec 22, 2005 1:49 pm
by shmp
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.

Posted: Thu Dec 22, 2005 5:06 pm
by Sergey Tkachenko
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.

Posted: Thu Dec 22, 2005 5:07 pm
by Sergey Tkachenko
shmp, in TMyShockwaveFlash, a new movie must be loaded using LoadFlash method.

Posted: Fri Dec 23, 2005 12:56 am
by shmp
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

Posted: Fri Dec 23, 2005 1:04 am
by shmp
Or most likely, swf do not know where the text filles are since it is working through a stream?

Henry.

Posted: Fri Dec 23, 2005 11:08 pm
by Sergey Tkachenko
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.