FlashPlayerControl Help >> Extensions >> Notifications

FPCN_LOADEXTERNALRESOURCE

Message

FPCN_LOADEXTERNALRESOURCE

Structure

struct SFPCLoadExternalResource
{    
    NMHDR hdr;
    
    LPCTSTR lpszRelativePath;
    LPSTREAM lpStream;
};

Description

The FPCN_LOADEXTERNALRESOURCE is sent when a movie tries to load an external resource (xml, jpeg, etc.) using a relative path. The message is sent 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 notification message FPCN_LOADEXTERNALRESOURCE:

LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg) 
	{
...
case WM_NOTIFY: { NMHDR* pNMHDR = (NMHDR*)lParam; if (pNMHDR->hwndFrom == g_hwndFlashPlayerControl) { switch (pNMHDR->code) { case FPCN_LOADEXTERNALRESOURCE: { SFPCLoadExternalResource* pInfo = (SFPCLoadExternalResource*)lParam; if (0 == lstrcmpi(pInfo->lpszRelativePath, _T("/images/external_image.jpg"))) { HMODULE hModule = GetModuleHandle(NULL); HRSRC hResInfo = FindResource(hModule, _T("IMAGE1"), _T("JPEG")); HGLOBAL hResData = LoadResource(hModule, hResInfo); LPVOID lpResourceData = LockResource(hResData); DWORD dwResourceSize = SizeofResource(hModule, hResInfo); ULONG ulWritten; pInfo->lpStream->Write(lpResourceData, dwResourceSize, &ulWritten); } break; } } } break; }
...
}

Flash versions

3: supported
4: supported
5: supported
6: supported
7: supported


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