Reset Control to initial state?

F-IN-BOX for Delphi / Builder C++ / VCL
artelogic
Posts: 11
Joined: Fri May 09, 2008 10:57 pm

Reset Control to initial state?

Postby artelogic » Sat May 10, 2008 5:17 pm

How can I reset the TFlashPlayerControl to a state like it is in right after Create, after I have loaded a movie via LoadMovie and played it with Play?

My problem indeed is, that it keeps showing the last frame of the played movie. I need a blank form after playing the movie.

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Re: Reset Control to initial state?

Postby Softanics » Sat May 10, 2008 5:30 pm

artelogic wrote:How can I reset the TFlashPlayerControl to a state like it is in right after Create, after I have loaded a movie via LoadMovie and played it with Play?

My problem indeed is, that it keeps showing the last frame of the played movie. I need a blank form after playing the movie.


Thank you for your question.

Please try this code:

Code: Select all

FlashPlayerControl1.Movie = '__';
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

artelogic
Posts: 11
Joined: Fri May 09, 2008 10:57 pm

Postby artelogic » Sat May 10, 2008 6:34 pm

Sorry, but this leads to an OleException with message 'Unknown Error' inside FlashPlayerControl.

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Sat May 10, 2008 8:50 pm

artelogic wrote:Sorry, but this leads to an OleException with message 'Unknown Error' inside FlashPlayerControl.


I'm sorry, could you please try:

Code: Select all

FlashPlayerControl1.Movie = 'file://__';
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

artelogic
Posts: 11
Joined: Fri May 09, 2008 10:57 pm

Postby artelogic » Sun May 11, 2008 9:21 pm

Still same exception!

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Mon May 12, 2008 9:35 am

artelogic wrote:Still same exception!


Very strange, because I've just tested this code and it works well.

So I can suggest you recreating the control, something like that:

Code: Select all

procedure TForm1.Button2Click(Sender: TObject);
begin
   FlashPlayerControl1 := TFlashPlayerControl.Create(Self);
   FlashPlayerControl1.Parent := Self;
   FlashPlayerControl1.Width := Width;
   FlashPlayerControl1.Height := Height;
   FlashPlayerControl1.Movie := ' ...your URL here... ';
end;
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

artelogic
Posts: 11
Joined: Fri May 09, 2008 10:57 pm

Postby artelogic » Mon May 12, 2008 12:31 pm

I tried it with

fpFlashPlayer.LoadMovie(0, 'file://__');

because I load and play it this way:

fpFlashPlayer.LoadMovie(0, 'SomeFlash.swf');
fpFlashPlayer.Play;


This doesnÒ‘t generate an exception, but also does not clear my window. I still see the last frame.

Recreating is not an option, because creating leads to those memory leaks I talked about in the other (forum-)thread!

artelogic
Posts: 11
Joined: Fri May 09, 2008 10:57 pm

Postby artelogic » Mon May 12, 2008 12:37 pm

Maybe I can call a native flash function, which clears the canvas. But since I am not a flash programmer, I do not know anything about flash programming...

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Mon May 12, 2008 5:20 pm

artelogic wrote:Maybe I can call a native flash function, which clears the canvas. But since I am not a flash programmer, I do not know anything about flash programming...


No, it's a bad idea.

What about loading a small blank flash movie? I can create such one for you.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

artelogic
Posts: 11
Joined: Fri May 09, 2008 10:57 pm

Postby artelogic » Mon May 12, 2008 5:42 pm

Then, if that is a bad idea, what is the purpose of
function CallFunction(const request: WideString): WideString; virtual;
?

But loading a blanking flash could be a solution for me. Would be pretty kind to provide me with such a flash!

artelogic
Posts: 11
Joined: Fri May 09, 2008 10:57 pm

Postby artelogic » Mon May 12, 2008 6:33 pm

btw: do you need the dimensions of my fp-control?

here you got the complete control:

object fpFlashPlayer: TTransparentFlashPlayerControl
Left = 0
Top = 0
Width = 544
Height = 404
Align = alClient
OnFSCommand = fpFlashPlayerFSCommand
OnClick = fpFlashPlayerClick
OnMouseMove = fpFlashPlayerMouseMove
FrameNum = -1
Playing = False
Quality = 1
ScaleMode = 3
AlignMode = 0
BackgroundColor = -1
Loop = False
WMode = 'Transparent'
Menu = True
Scale = 'NoScale'
DeviceFont = False
EmbedMovie = False
Quality2 = 'High'
AllowScriptAccess = 'always'
StandartMenu = True
MakeParentTransparent = True
end

as you can see, it is transparent, which is also the desired aim. i finally want a transparent form.

tia
chris

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Mon May 12, 2008 6:43 pm

artelogic wrote:Then, if that is a bad idea, what is the purpose of
function CallFunction(const request: WideString): WideString; virtual;
?


It's a function related with External API:
http://www.f-in-box.com/delphi/#feature_external_api
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Mon May 12, 2008 6:50 pm

artelogic wrote:But loading a blanking flash could be a solution for me. Would be pretty kind to provide me with such a flash!


I've uploaded it here:
http://f-in-box.com/misc/9C38F729-4928- ... /empty.swf
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

artelogic
Posts: 11
Joined: Fri May 09, 2008 10:57 pm

Postby artelogic » Mon May 12, 2008 7:31 pm

Thank you very much! But now I found out, what the problem was with your
fpFlashPlayer.Movie:='file://__';

Since I want to erase all when I close (hide) the form, it is necessary to call Application.ProcessMessages after setting the Movie property. ;)

like that:

procedure TFlashShowForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caHide;
fpFlashPlayer.Movie:='file://__';
Application.ProcessMessages;
end;

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Tue May 13, 2008 10:31 am

artelogic wrote:Thank you very much! But now I found out, what the problem was with your
fpFlashPlayer.Movie:='file://__';

Since I want to erase all when I close (hide) the form, it is necessary to call Application.ProcessMessages after setting the Movie property. ;)


:)

So now it works well?
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html


Return to “Delphi / Builder / VCL Edition”

Who is online

Users browsing this forum: No registered users and 13 guests

cron