ParaScripting::ParaFlashPlayer Class Reference
[ParaUI]

List of all members.

Detailed Description

a flash player


Public Member Functions

 ParaFlashPlayer (int nFlashPlayerIndex)
bool IsValid ()
 check if the object is valid
const char * GetFileName ()
 get texture
int GetIndex ()
 get index from
bool IsFree ()
 whether the current player is free to load a new movie.
void LoadMovie (const char *filename)
 load a movie by file name, it can be URL, a virtual file, a file, or a resource
void UnloadMovie ()
 unload current movie.
void PutFlashVars (const char *args)
 put flash variables
const char * CallFlashFunction (const char *sFunc)
 [ ActionScript ] import flash.external.
void InvalidateDeviceObjects ()
 release d3d texture.
void GetTextureInfo (int &width, int &height)
 get texture info in NPL, it is as below local width, height; self:GetTextureInfo(width, height);
int SendMessage (unsigned int Msg, DWORD wParam, DWORD lParam)
 send a windows message to the inner flash player window.

Public Attributes

int m_nFlashPlayerIndex


Member Function Documentation

bool ParaScripting::ParaFlashPlayer::IsFree (  ) 

whether the current player is free to load a new movie.

void ParaScripting::ParaFlashPlayer::UnloadMovie (  ) 

unload current movie.

However d3d texture and the flash player window are not released for reuse.

void ParaScripting::ParaFlashPlayer::PutFlashVars ( const char *  args  ) 

put flash variables

Parameters:
args,: such as "company=http://paraengine.com"

const char * ParaScripting::ParaFlashPlayer::CallFlashFunction ( const char *  sFunc  ) 

[ ActionScript ] import flash.external.

*; ExternalInterface.addCallback("CallMeFromApplication", this, InternalFunction);

function InternalFunction(str: String): String { TextArea1.text = str; return "The function was called successfully"; [ C++ ] string res = CallFlashFunction("<invoke name=\"CallMeFromApplication\" returntype=\"xml\"><arguments><string>Some text for FlashPlayerControl</string></arguments></invoke>");

Parameters:
res,: result is returned as a string.
Note:
: the max return string length of the flash function can not exceed 2048 bytes. }

void ParaScripting::ParaFlashPlayer::InvalidateDeviceObjects (  ) 

release d3d texture.

void ParaScripting::ParaFlashPlayer::GetTextureInfo ( int &  width,
int &  height 
)

get texture info in NPL, it is as below local width, height; self:GetTextureInfo(width, height);

Parameters:
width [in|out]
height [in|out]
Returns:

int ParaScripting::ParaFlashPlayer::SendMessage ( unsigned int  Msg,
DWORD  wParam,
DWORD  lParam 
)

send a windows message to the inner flash player window.

in most cases: we will forward mouse and key messages to the flash player using this function.

Parameters:
Msg,: Msg = 0: single click, wParam contains the relative X position and lParam contains the relative Y position. it also set the key focus window to this flash window. Because the game engine app always captures the mouse, the single click function will actually send a pair of Left button down and up message to the flash control. The first click set the mouse focus and the second performs the actual click. Then the flash control will soon lose mouse capture to the game engine.

this will set the focus

the first click set the focus from the game engine to the flash control

the second click performs the actual click.


Generated on Mon Dec 1 14:34:45 2008 for NPL Scripting Reference for ParaEngine by  doxygen 1.5.2