[Swfdec] AS context->global not an object problem
Paul Brooker
paul at thefunnyfish.net
Mon Feb 8 15:51:35 PST 2010
Hi, another quick question,
Im trying to set a variable within the flash movie at runtime. Im trying to set the variable triggered by fscommand, the code im using so far is...
static void
do_fscommand (SwfdecPlayer *player, const char *command, const char *value)
{
SwfdecAsValue val;
SwfdecAsContext *context;
if (g_str_equal (command, "test")) {
context = SWFDEC_AS_CONTEXT (player);
SWFDEC_AS_VALUE_SET_STRING (&val, "success!");
swfdec_as_object_set_variable (context->global, swfdec_as_context_get_string (context, "teststring"), &val);
}
}
Firstly, im not sure if this is the correct approach, but more importantly it fails because there appears to be no global object. Ive tested that the
context is in a running state which it is, plus ive tried sticking similar code in swfdec_as_context_startup which works ok, so i know context->global
is valid at this point. Im guessing theres something fundamental im not understanding!
Im hoping someone can help shed some light :)
Thanx, Paul
More information about the Swfdec
mailing list