Siento ser tan pesado, pero queda completo ya cuando se le a�ade la propiedad
lapsus para controlar el tiempo que ha de transcurrir entre cada pulsaci�n, en
segundos claro:
<code>
MovieClip.prototype.setOnPress = function(ref) {
this.$onPress = ref;
};
MovieClip.prototype.getOnPress = function() {
return this.onPress;
};
MovieClip.prototype.onEnterFrame = function() {
this.$lapsus = 500;
this.onEnterFrame = null;
};
MovieClip.prototype.setLapsus = function (ref) {
this.$lapsus = ref;
}
MovieClip.prototype.getLapsus = function (ref) {
return this.$lapsus;
}
MovieClip.prototype.onPress = function() {
if (this.$dobleClick)
{
this.$timer = new Date().getTime();
if (Math.abs(this.$firstTime-this.$timer)<=this.$lapsus)
{
this.$onDobleClick();
}
else
{
this.$firstTime = this.$timer;
}
}
else
{
this.$onPress();
}
};
MovieClip.prototype.getOnDobleClick = function() {
return this.onDobleClick;
};
MovieClip.prototype.setOnDobleClick = function(ref) {
this.$onDobleClick = ref;
if (ref != null)
{
this.$dobleClick = true;
}
else
{
this.$dobleClick = false;
}
};
MovieClip.prototype.addProperty("onDobleClick", this.getOnDobleClick,
this.setOnDobleClick);
MovieClip.prototype.addProperty("onPress", this.getOnPress, this.setOnPress);
MovieClip.prototype.addProperty("lapsus", this.getLapsus, this.setLapsus);
</code>
Y creo que ya no le falta nada.
Sixto
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
<!-------------------------------
Lista ASNativos:
subscripciones/desubscripciones
http://www.sidedev.net/asnativos
-------------------------------->