开发者

Flash player: usage

开发者 https://www.devze.com 2022-12-27 02:19 出处:网络
I use Adobe flash player in my site, and now I need to increment some filed in the database when a user clicks on the player.

I use Adobe flash player in my site, and now I need to increment some filed in the database when a user clicks on the player. here is the script

<div id="conteiner" style="text-align: center;" ></div>
<script type="text/javascript">
            var s1 = new SWFObject("player.swf","ply","420","380","9","#FFFFFF");
            s1.addParam("allowfullscreen","true");
            s1.addParam("allowscriptaccess","always");
            s1.addParam("flashvars","file=<?=$video ?>");
            s1.write("conteiner");
        </script>

I decided to use AJAX for it, but how can I write a function in the flash object? Thanks in advance

UPDATE: I only have the swfobject.js file, which contains such data

if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer开发者_开发技巧=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7)
...

and the player.swf, and the HTML, I've shown already. I don't know is this flash player or no, and what can I do?


Scripts in HTML don't get to listen to clicks in plugins. If you want to be informed of a click in a Flash embed, you will have to add code to the Flash movie to pass notification of the click back up to JavaScript.

What video player are you using? It might already offer this feature — check its docs. If not you'll need the source code to alter and recompile.

0

精彩评论

暂无评论...
验证码 换一张
取 消