I will defer to others on this, but as far as I know, it is not possible to
introspect the internal EI available methods on a given swf. You have to
know the name of the function you want to call. You can check if the method
is actually available on the swf like:

var obj = document.getElementById("myCom");
if (obj && typeof obj.SetVariable != "undefined") {
        obj.SetVariable("JStoASviaSetVariable",
document.getElementById("send").value);
}

(from
http://www.bobbyvandersluis.com/swfobject/testsuite_2_1/test_dynamic_com.htm
l )



Cheers,
Aran

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of kofkof
Sent: Thursday, 5 March 2009 7:02 PM
To: SWFObject
Subject: Get an object's flash methods via Javascript


Hello,

My question does not deal specifically with swfobject, but with flash-
javascript communication, and I think this group is the best place to
post it. Disclaimer: I'm a not a Flash/AS developer.
I have a Flash Movie with methods callable from Javascript. For
example the following js code works :
/***************/
var flashMovie = document.getElementById(flashMovieId);
flashMovie.setSettings(/*some settings for the flash movie*/);
/***************/

I'd like to be able to get, in Javascript (programmatically, then),
the list of all flash methods that are callable on a given flashMovie.
I tried the following code :

/**************/
flashMovie = document.getElementById(flashMovieId);
var propNames = [];
for (thisProp in flashMovie) {
    propNames.push(thisProp);
}
return propNames;
/*******************/

But those flash methods don't show up in my propNames array, though
they actually exist:

/*******************/
flashMovie.setSettings != undefined // true
propNames['setSettings'] != undefined // false
/*******************/

Does anybody have an idea on how I can do this?




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to