Is is possible to click/get ActionScript values/actions using Javascript without ExternalInterface?
Is the how GreaseMonkey works? Can I do that using GreaseMonkey?
Is is possible to click/get ActionScript values/actions using Javascript without ExternalInterface?
Is the how GreaseMonkey works? Can I do that using GreaseMonkey?
how about
swf=document.embeds[0];//or 1 or 2 etc
swfvar1=swf.GetVariable("swfvariable");
swfvar2="something";
swf.SetVariable("swfvariable",swfvar2);
its GetVariable("swfvar"); with the var name as a string and SetVariable("swfvar",jsval); with the swfvar name as a string and the js value whatever you want
to execute function, there are 2 ways 1. using the code above with the var swf, swf.SwfFunc(params); simple, right? yes.
2.again with code above swf.GetVariable("SwfFunc(params)"); since it gets the value of the function, it executes it all to look for a return value, might be bad if the params are ugly with overlapping quotes because there are already quotes in the call
personally, I like method 2 because it can be used for other purposes too, like executing code. like this
swf.GetVariable("
function(){
//whatever
}");
I find this very useful, but remember you must escape the quotes in that function it is actually like injecting an eval statement, but better
it's rather hard but maybe possible to implement LocalConnection or NetStream direct connection (for using the send() method) in javascript :)
the other way is to use something as a buffer that'll be checked by SWF and javascript every certain time. A simple php script will be a good buffer, also maybe this data could be stored in browser adress bar after#
and another funny idea: you can develop an SWF messenger that will be loaded every time you need to pass a message to flash. message is passed to the messenger as get variables and it will create a LocalConnection with the main swf and pass data there. but the only way to call js from flash is navigateToURL or maybe sendToURL