FlashPlayerControl Help >> Access to Native Flash ActiveX Interface >> Properties

FlashVars

Description

Used to send root level variables to the movie. The format of the string is a set of name=value combinations separated by '&'. Browsers will support string sizes of up to 64KB (65535 bytes) in length.

Messages

FPCM_GET_FLASHVARS
FPCM_PUT_FLASHVARS

Structures

struct SFPCGetFlashVars
{    
     // [in, out]
     LPTSTR lpszBuffer;
     DWORD dwBufferSize;
     // [out]
     HRESULT hr;
};

struct SFPCPutFlashVars
{    
     // [in]
     LPCTSTR lpszBuffer;
     // [out]
     HRESULT hr;
};

Example

void GetFlashVars(HWND hwndFlashPlayerControl)
{
     SFPCGetFlashVars info;

     info.lpszBuffer = NULL;

     ::SendMessage(hwndFlashPlayerControl, FPCM_GET_FLASHVARS, 0, (LPARAM)&info);

     if FAILED(info.hr)
          // Error
     {
          return;
     }

     info.lpszBuffer = (TCHAR*)LocalAlloc(LPTR, info.dwBufferSize * sizeof(TCHAR));

     ::SendMessage(hwndFlashPlayerControl, FPCM_GET_FLASHVARS, 0, (LPARAM)&info);
    
     if FAILED(info.hr)
          // Error
     {
          // ...
     }
     else
          // OK
     {
          ::MessageBox(NULL, info.lpszBuffer, _T("Result"), MB_OK);
     }

     LocalFree((HLOCAL)info.lpszBuffer);
}

void PutFlashVars(HWND hwndFlashPlayerControl, LPCTSTR FlashVars)
{
     SFPCPutFlashVars info;

     info.lpszBuffer = FlashVars;

     ::SendMessage(hwndFlashPlayerControl, FPCM_PUT_FLASHVARS, 0, (LPARAM)&info);
    
     if FAILED(info.hr)
          // Error
     {
          // ...
     }
     else
          // OK
     {
          // ...
     }
}

Flash versions

5: not supported
6: not 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.