In Java Script at the top of my "movie":
Code: Select all
_root.newMessage="internal";
_root.watch("newMessage", canvas.OnNewMessage);
Right now all that OnNewMessage does is output the value of _root.NewMessage.
From the win32 app I do call the following function with cmd="newMessage" and val="test":
Code: Select all
void NotifyFlashPlugin( string cmd, string val )
{
SFPCSetVariable infoSet;
infoSet.name.lpszBuffer = (LPCSTR)cmd.c_str();
infoSet.value.lpszBuffer = (LPCSTR)val.c_str();
::SendMessage(g_hFlashPlayer, FPCM_SETVARIABLE, 0, (LPARAM)&infoSet);
}
This causes the event to fire in javascript however the value outputs as "internal". If I perform this operation twice, _root.newMessage becomes "undefined". Can someone please point me in the right direction????