views:

42

answers:

1

i use Adobe flash player in my site, and now i need to increment some filed in database, when user click on 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 deside 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 allready. i don't now is this flash player or no, and what can i do?

A: 

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.

bobince
@bobince SWFObject v1.5: http://blog.deconcept.com/swfobject/, but i don't understand it at all:(
Syom
@Syom SWFObject is not a video player. It is merely a javascript library that helps you to load flash files.
davr
@davr look at update please
Syom
We've seen the update, the question remains: what is `player.swf`? It is that, the Flash file, that needs to support click interaction. SWFObject is of no interest.
bobince