 |
| 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, deine Frage 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 |
27.09.2003, 11:04
|
#1
|
|
TP-Moderator
Registriert seit: Oct 2002
Ort: Berlin/Germany
|
Feldmatrix Prototype
Hier ein neuer Prototype zum spielen:
Code:
MovieClip.prototype.setMatrix = function (pClip, pReihen, pSpalte, pDim, pDist, pFarbe, pAlpha, pAbstand, pMax, pMin, pMult, pFraktion) {
var tiefe;
for (var i = 0; i<pReihen; i++) {
for (var j = 0; j<pSpalte; j++) {
this[pClip] = this.createEmptyMovieClip(pClip+j+"_"+i, tiefe++);
with (this[pClip]) {
beginFill(pFarbe, pAlpha);
moveTo(-pDim, -pDim);
lineTo(pDim, -pDim);
lineTo(pDim, pDim);
lineTo(-pDim, pDim);
lineTo(-pDim, -pDim);
_x = Math.round(i*((2*pDim)+pDist)+Stage.width/2-((pReihen-1)*((2*pDim)+pDist)/2));
_y = Math.round(j*((2*pDim)+pDist)+Stage.height/2-((pSpalte-1)*((2*pDim)+pDist)/2));
}
this[pClip].onEnterFrame = function() {
this.abstX = this._x-_root._xmouse;
this.abstY = this._y-_root._ymouse;
this.abstand = Math.sqrt((this.abstX*this.abstX)+(this.abstY*this.abstY));
if (this.abstand<pAbstand) {
this.dimX = pMax-this.abstand;
this.dimY = pMax-this.abstand;
} else {
this.dimX = pMin;
this.dimY = pMin;
}
this.skalX = ((this.dimX-this._xscale)*pMult)+(this.skalX*pFraktion);
this.skalY = ((this.dimY-this._yscale)*pMult)+(this.skalY*pFraktion);
this._xscale += this.skalX;
this._yscale += this.skalY;
};
}
}
}
// Verwenden
this.setMatrix("feld", 10, 10, 10, 4, 0x0000ff, 25, 150, 250, 100 ,.36, .75);
Einfach kopieren und einfügen.
Variante:
Code:
// Ebene 1
this.setMatrix("feld", 10, 10, 10, 0, 0xffff00, 25, 150, 250, 100 ,.36, .75);
// Ebene 2
this.createEmptyMovieClip("mc",100);
this.mc.setMatrix("feld", 10, 10, 10, 0, 0xff0000, 25, 150, 250, 100 ,.36, .90);
// Ebene 3
this.createEmptyMovieClip("mc2",200);
this.mc2.setMatrix("feld", 10, 10, 10, 0, 0x0000ff, 25, 150, 250, 100 ,.36, .20);
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 02:18 Uhr.
|
 |