Matthias Kannengiesser
Erfahrenes Mitglied
Hier ein neuer Prototype zum spielen:
Einfach kopieren und einfügen.
Variante:
Liebe Grüsse
Matze K.
PHP:
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:
PHP:
// 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.