 |
| Hinweise |
Willkommen im TP-Hilfe-Forum!Dies ist ein Forum zu den Themen Photoshop, Dreamweaver, Flash, Selbständigkeit und mehr, in dem Du Hilfe, Anleitung oder eine Lösung zu Deinen Problemen erhältst. Aktuell bist Du in unseren Foren als Gast mit reinen Leserechten unterwegs. Wenn Du Dich registrierst, kannst Du eigene Themen verfassen, Fragen stellen und privat mit anderen TPlern kommunizieren. Weitere Foren werden zugänglich, und Du wirst – falls gewünscht – per Mail über neue Beiträge informiert. Die Registrierung ist schnell und kostenlos. Sollten bei der Registrierung Fragen auftauchen, reicht ein Klick in unsere Hilfe - Häufig gestellte Fragen oder eine kurze Mitteilung an das Support-Team. Viel Spaß bei Traum-Projekt.com |
16.05.2005, 15:57
|
#1
|
|
TP-Moderator
Registriert seit: Oct 2002
Ort: Berlin/Germany
|
Zoom-Effekt (Prototypen)
Hier eine Sammlung von nützlichen Zoom-Prototypes.
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);
};
Zusatz:
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);
};
Be inspired...
Liebe Grüsse
Matze K.
|
|
|
|
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
|
|
|
| Themen-Optionen |
Thema durchsuchen |
|
|
|
| Thema bewerten |
|
|
Forumregeln
|
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.
HTML-Code ist aus.
|
|
|
Alle Zeitangaben in WEZ +2. Es ist jetzt 08:57 Uhr.
|
 |