getreidemuehlen
-


Hinweise


Antwort
 
LinkBack Themen-Optionen Thema durchsuchen Thema bewerten
Alt 27.09.2003, 11:04   #1
TP-Moderator
 
Benutzerbild von Madokan
 
Registriert seit: Oct 2002
Ort: Berlin/Germany
Madokan bringt sich richtig ein
Lightbulb

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.
Madokan ist offline   Mit Zitat antworten


Antwort

  Aktuelles Thema
  TP Hilfe Forum > Web-Editoren & Coding > Flash > Sammlung Actionscript 1 und 2
Feldmatrix Prototype Feldmatrix Prototype
« IsoMove (Prototype) | Flash Crypto Pack v1.0 »

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Thema bewerten
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.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 02:18 Uhr.

Powered by: vBulletin Version 3.7 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd. / Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Traum-Projekt.com | Suchen | Archiv | Impressum | Kontakt | | | Nach oben |



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67