admin管理员组文章数量:1325726
I have to call an ActionScript method via Javascript, but I have a problem accessing the flash object itself. I embed the flash file via the help of swfobject.
Previously, when I use the static publishing approach, I could easily get the flash object by calling these methods:
swfobject.registerObject("flash_object", "9", "expressInstall.swf");
var flash_object = swfobject.getObjectById("flash_object");
For some technical reasons, now I have to use the dynamic publishing approach (using swfobject.embedSWF). But, as mentioned in the documentation, the method getObjectById can only be used if you use static publishing approach.
Now, how can I access the flash object?
Cheers, Andree
I have to call an ActionScript method via Javascript, but I have a problem accessing the flash object itself. I embed the flash file via the help of swfobject.
Previously, when I use the static publishing approach, I could easily get the flash object by calling these methods:
swfobject.registerObject("flash_object", "9", "expressInstall.swf");
var flash_object = swfobject.getObjectById("flash_object");
For some technical reasons, now I have to use the dynamic publishing approach (using swfobject.embedSWF). But, as mentioned in the documentation, the method getObjectById can only be used if you use static publishing approach.
Now, how can I access the flash object?
Cheers, Andree
Share Improve this question asked Mar 27, 2010 at 22:42 AndreeAndree 3,1036 gold badges39 silver badges57 bronze badges2 Answers
Reset to default 5With the good old document.getElementById("flash_object")
Just be sure to do it after page load. You can set it up via the callback function, too:
var mySWF = null;
var flashvars = {};
var params = {};
var attributes = {};
var embedHandler = function (e){
mySWF = e.ref; //e.ref is a pointer to the <object>
//do something with mySWF
};
swfobject.embedSWF("/path/to/file.swf", "flash_object", "550", "400", "9", "/path/to/expressInstall.swf", flashvars, params, attributes, embedHandler);
I would suggest going through the documentation on How to Integrate Flex with Java EE applications.
It explains how to use Flashvars to pass data from javascript to actionscript method. I used it myself and it works just fine.
本文标签: javascriptHow to access a flash object embedded via swfobject39s embedSWFStack Overflow
版权声明:本文标题:javascript - How to access a flash object embedded via swfobject's embedSWF? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742194379a2430805.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论