F-IN-BOX Delphi Edition Help >> TFlashPlayerControl / TTransparentFlashPlayerControl >> Events >> Extensions

OnLoadExternalResource

Syntax

type TFlashPlayerControlOnLoadExternalResource = procedure(ASender: TObject; const URL: WideString; Stream: TStream) of object;
property OnLoadExternalResource: TFlashPlayerControlOnLoadExternalResource;

Remark

From version 3.1 the argument URL has been changed to WideString (in previous versions the type was AnsiString / string).

Description

The event OnLoadExternalResource is called when a movie tries to load an external resource (xml, jpeg, etc.) using a relative path. The event is called only if the movie is loaded from a stream.

For instance, a movie loads an image using the following code:

loadMovie("images/external_image.jpg", "square");

You can provide the content of this image by handling the event OnLoadExternalResource:

procedure TForm1.FlashPlayerControl1LoadExternalResource(ASender: TObject; const URL: WideString; Stream: TStream);
var
  ResourceStream: TResourceStream;
begin
  if URL = 'images/external_image.jpg' then
  begin
    ResourceStream := TResourceStream.Create(0, 'some_image', 'IMAGE');
    ResourceStream.SaveToStream(Stream);
    ResourceStream.Free;
  end;
end;

More about TFlashPlayerControl
Copyright © 2004 - 2008 Softanics. All rights reserved.
Delphi is a trademark of Borland Software Corporation.
Macromedia and Shockwave Flash are trademarks of Macromedia, Inc.