[Swfdec] Actionscript <-> C/C++ with SwfdecPlayerScripting
th
th at tobidesign.de
Tue May 25 02:13:56 PDT 2010
Hi,
I am trying to understand how to access the internal Actionscript of a SWF.
I’d like to catch Events and exchange with my C/C++ code.
There is a small description about the SwfdecPlayerScripting Object in
http://swfdec.freedesktop.org/documentation/swfdec/SwfdecPlayerScripting.html.
And I tried to implement a small test application (I only show the important
parts below).
My Problem is, how can I instantiate the SwfdecPlayerScripting struct correctly.
I read that this works somehow like this:
http://library.gnome.org/devel/gobject/unstable/gtype-instantiable-classed.html,
but I can’t get it to work.
So how is it done correctly?
And is there a proper example of how to set/get data to/from actionscript i.e.
the running SWF?
Thanks in advance,
Tobias
---------------------------------------------------------
#include <swfdec-0.8/swfdec/swfdec.h>
#include <swfdec-0.8/swfdec/swfdec_player.h>
…
SwfdecPlayerScripting *myInternalScript;
char* my_js_get_id(SwfdecPlayerScripting *scripting, SwfdecPlayer *player)
{
return null;
}
char * my_js_call(SwfdecPlayerScripting *scripting,SwfdecPlayer *player, const
char *code)
{
return null;
}
char* my_xml_call(SwfdecPlayerScripting *scripting, SwfdecPlayer *player, const
char *xml)
{
return null;
}
void initScripting()
{
myInternalScript = new SwfdecPlayerSripting();
myInternalScript->js_get_id = &my_js_get_id;
myInternalScript->js_call = &my_js_call;
myInternalScript->xml_call = &my_xml_call;
}
int main()
{
…
initScripting();
// player init
…
// player scripting
swfdec_player_set_scripting(player, myInternalScript);
…
}
More information about the Swfdec
mailing list