flash - How can i invoke my own javascript API on my SWF dynamically embeded using swfOject? -
i using swfobject library dynamically embed mp3 player i've made in flash cs5. in .fla file, i've declared list of methods can called via javascript (using flash.external.externalinterface flash class).
that's not problem since these function work when called google chrome's console. however, swfobject provides way invoke javascript api if .swf has been statically included (i.e. using swfobject.registerobject() ) can't find way achieve same goal when .swf dynamically included (i.e. using swfobject.embedswf() ).
thanks in advance , contibutions :)
when using swfobject.embedswf, can specify id of swf object in attributes parameters :
swfobject.embedswf(swfurl, id, width, height, version, expressinstallswfurl, flashvars, params, attributes, callbackfn)
example :
swfobject.embedswf( "yourflash.swf", "wheretoplacethis", "0px", "0px", "10.0.0", "expressinstall.swf", {}, {}, { id : "idoftheswf" }, function () { var swf = document.getelementbyid("idoftheswf"); // that's swf // swf.yourflashfunction(); // , can invoke function // } );
Comments
Post a Comment