Hier eine Sammlung von nützlichen Zoom-Prototypes.
Zusatz:PHP-Code:MovieClip.prototype.ZoomDiv = function (pDim, pTempo)
{
this.onEnterFrame = function ()
{
if (this._xscale < pDim - 1 / pTempo)
{
this._xscale = this._xscale + (pDim - this._xscale) / pTempo;
this._yscale = this._yscale + (pDim - this._yscale) / pTempo;
}
else if (this._xscale > pDim + 1 / pTempo)
{
this._xscale = this._xscale + (pDim - this._xscale) / pTempo;
this._yscale = this._yscale + (pDim - this._yscale) / pTempo;
}
else
{
this._xscale = this._yscale = pDim;
delete this.onEnterFrame;
}
};
};
ASSetPropFlags(MovieClip.prototype, "ZoomDiv", 1);
MovieClip.prototype.ZoomPulsar = function (pDim, pTempo)
{
this.onEnterFrame = function ()
{
if (this._xscale < pDim)
{
this._xscale = this._yscale += pTempo;
}
else if (this._xscale > pDim)
{
this._xscale = this._yscale -= pTempo;
}
else
{
this._xscale = this._yscale = pDim;
delete this.onEnterFrame;
}
};
};
ASSetPropFlags(MovieClip.prototype, "ZoomPulsar", 1);
MovieClip.prototype.ZoomAdd = function (pOption, pDim, pTempo)
{
if (pOption)
{
this.onEnterFrame = function ()
{
if (this._xscale < pDim)
{
this._xscale = this._yscale += pTempo;
}
else
{
this._xscale = this._yscale = pDim;
delete this.onEnterFrame;
}
};
}
else
{
this.onEnterFrame = function ()
{
if (this._xscale > pDim)
{
this._xscale = this._yscale -= pTempo;
}
else
{
this._xscale = this._yscale = pDim;
delete this.onEnterFrame;
}
};
}
};
ASSetPropFlags(MovieClip.prototype, "ZoomAdd", 1);
// Ausfürhen (Testen)
mc.onRollOver = function ()
{
this.ZoomDiv (200, 6);
};
mc.onRollOut = function ()
{
this.ZoomDiv (100, 6);
};
mc2.onRollOver = function ()
{
this.ZoomPulsar (200, 6);
};
mc2.onRollOut = function ()
{
this.ZoomPulsar (100, 6);
};
mc3.onRollOver = function ()
{
this.ZoomAdd (true, 200, 6);
// ZoomIn (true)
};
mc3.onRollOut = function ()
{
this.ZoomAdd (false, 100, 6);
// ZoomOUt (false)
};
// Interval-Varianten
MovieClip.prototype.ZoomInterval = function (pOption, pDim, pTempo, pBps)
{
var obj = this;
clearInterval(obj.iv);
if (pOption)
{
obj.zoomIn = function ()
{
if (obj._xscale < pDim)
{
obj._xscale = obj._yscale += pTempo;
}
else
{
obj._xscale = obj._yscale = pDim;
clearInterval(obj.iv);
delete obj.iv;
delete obj.zoomIn;
delete obj.zoomOut;
}
};
obj.iv = setInterval(obj.zoomIn,1000/pBps);
}
else
{
obj.zoomOut= function ()
{
if (obj._xscale > pDim)
{
obj._xscale = obj._yscale -= pTempo;
}
else
{
obj._xscale = obj._yscale = pDim;
clearInterval(obj.iv);
delete obj.iv;
delete obj.zoomIn;
delete obj.zoomOut;
}
};
obj.iv = setInterval(obj.zoomOut,1000/pBps);
}
};
ASSetPropFlags(MovieClip.prototype, "ZoomInterval", 1);
mc4.onRollOver = function ()
{
this.ZoomInterval (true, 200, 6, 24); // ZoomIn (true) / 24 -> 24 Bps (Dokument-Einstellung)
};
mc4.onRollOut = function ()
{
this.ZoomInterval (false, 100, 6, 24); // ZoomOUt (false) / 24 -> 24 Bps (Dokument-Einstellung)
};
MovieClip.prototype.ZoomIntervalDiv = function (pDim, pTempo, pBps)
{
var obj = this;
clearInterval(obj.iv);
obj.zoom = function ()
{
if (obj._xscale < pDim - 1 / pTempo)
{
obj._xscale = obj._xscale + (pDim - obj._xscale) / pTempo;
obj._yscale = obj._yscale + (pDim - obj._yscale) / pTempo;
}
else if (obj._xscale > pDim + 1 / pTempo)
{
obj._xscale = obj._xscale + (pDim - obj._xscale) / pTempo;
obj._yscale = obj._yscale + (pDim - obj._yscale) / pTempo;
}
else
{
obj._xscale = obj._yscale = pDim;
clearInterval(obj.iv);
delete obj.iv;
delete obj.zoom;
}
};
obj.iv = setInterval(obj.zoom,1000/pBps);
};
ASSetPropFlags(MovieClip.prototype, "ZoomIntervalDiv", 1);
mc5.onRollOver = function ()
{
this.ZoomIntervalDiv (200, 6, 24);
};
mc5.onRollOut = function ()
{
this.ZoomIntervalDiv (100, 6, 24);
};
Be inspired...PHP-Code:Object.prototype.ZoomIntervalDiv = function (pDim, pTempo, pBps)
{
var obj = this;
clearInterval(obj.iv);
obj.zoom = function ()
{
if (obj._xscale < pDim - 1 / pTempo)
{
obj._xscale = obj._xscale + (pDim - obj._xscale) / pTempo;
obj._yscale = obj._yscale + (pDim - obj._yscale) / pTempo;
}
else if (obj._xscale > pDim + 1 / pTempo)
{
obj._xscale = obj._xscale + (pDim - obj._xscale) / pTempo;
obj._yscale = obj._yscale + (pDim - obj._yscale) / pTempo;
}
else
{
obj._xscale = obj._yscale = pDim;
clearInterval(obj.iv);
delete obj.iv;
delete obj.zoom;
}
};
obj.iv = setInterval(obj.zoom,1000/pBps);
};
ASSetPropFlags(Object.prototype, "ZoomIntervalDiv", 1);
clip_mc.onRollOver = function ()
{
this.ZoomIntervalDiv (200, 6, 24);
};
clip_mc.onRollOut = function ()
{
this.ZoomIntervalDiv (100, 6, 24);
};
but_btn.onRollOver = function ()
{
this.ZoomIntervalDiv (200, 6, 24);
};
but_btn.onRollOut = function ()
{
this.ZoomIntervalDiv (100, 6, 24);
};
Liebe Grüsse
Matze K.
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)