question about loadmovie method and OnLoadExternalResource

F-IN-BOX for Delphi / Builder C++ / VCL
coolshadow
Posts: 67
Joined: Fri Oct 10, 2008 7:42 am

question about loadmovie method and OnLoadExternalResource

Postby coolshadow » Tue Nov 18, 2008 5:18 am

OnLoadExternalResource event will be called when the flashplayercontrol begin to load a resource.

But I find that, if you call loadmovie method, OnLoadExternalResource will not be called.

How can I to make this?
OnLoadExternalResource will be called after we call loadmovie method?

coolshadow
Posts: 67
Joined: Fri Oct 10, 2008 7:42 am

Postby coolshadow » Tue Nov 18, 2008 5:28 am

sometimes the _url of mainswf will be checked by flash, so if we can't use loadmovie method to load the mainswf, problem happens.

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

Postby Softanics » Tue Nov 18, 2008 7:41 pm

Thank you for your question.

Do you mean that Flash checks an URL and OnLoadExternalResource is not called? Could you please show me an example?

Thank you.
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

coolshadow
Posts: 67
Joined: Fri Oct 10, 2008 7:42 am

Postby coolshadow » Wed Nov 19, 2008 3:36 am

I've send you a email with a sample swf file.
And I describe the question in the email.

Thanks.

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

Postby Softanics » Thu Nov 20, 2008 9:49 am

The task is the following.

For example, a flash movie contains the code:

Code: Select all

if(this._url=="WWW.AAA.COM")
{
       gotoAndStop(3);
}else{
       gotoAndStop(2);
}


If we load such movie using LoadMovieFromStream, gotoAndStop(2); is executed. But how to make the movie thinking that this._url is really "WWW.AAA.COM"?

The solution.

Use a global handler to provide content of the movie:

Code: Select all

FlashPlayerControl.SetGlobalOnLoadExternalResourceHandler(ContentProvider);
FlashPlayerControl1.Movie := 'http://WWW.AAA.COM';
...
procedure TMainForm.ContentProvider(const URL: WideString; Stream: TStream);
begin
  if URL = 'http://WWW.AAA.COM' then
  begin
    // For example, copy data from TResourceStream to Stream
  end;
end;


Thank you.
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 17 guests

cron