Help with SetVariable.

DLL Edition of the F-IN-BOX
chris1228
Posts: 16
Joined: Wed Nov 16, 2005 6:59 pm

Help with SetVariable.

Postby chris1228 » Wed Nov 16, 2005 7:06 pm

I am pulling my hair out trying to use SetVariable. I am using OpenLaszlo for my flash compiler and a win32 client to host the flash player control. Here is what I am doing:

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????

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Wed Nov 16, 2005 7:30 pm

You can send me zipped project to support (at) flashplayercontrol.com
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

chris1228
Posts: 16
Joined: Wed Nov 16, 2005 6:59 pm

Postby chris1228 » Wed Nov 16, 2005 7:42 pm

Can't I just get a better example posted here than is the help file? Its kind of hard to send the zipped project as much of the code is very proprietary.

theomania
Posts: 12
Joined: Thu Nov 03, 2005 4:31 pm

I would say...

Postby theomania » Mon Nov 21, 2005 4:14 am

If you are defining your variable as a _root.<> then you should reference it the same way from Win32. This goes with _global.<> definitions aswell.

If you are referencing a value in the 'root', you may not even have to define _root in either the AS or the Win32.

T.


Return to “DLL Edition”

Who is online

Users browsing this forum: No registered users and 5 guests

cron