Thema: Prototype
Beiträge zum Thema "Prototype"
| Prototype: setSectionPoints [Flash 8]Tausender Punkte setzen
Math.setSectionPoints = function (z) {
var z1 = String(z).split(".");
if (z1.length <= 3) return z1.join(",");
var i_array = z1.split("").reverse();
var o_array = new Array();
o_array.push("," + z1);
var count = [...]
|
| Prototype: limitTextLength [Flash 8]Zu langen Text mit \"...\" begrenzen
TextField.prototype.limitTextLength = function (myWidth) {
this.autoSize = "left";
var myFormat = this.getTextFormat();
var myText = this.text;
w = this.textWidth;
trace (w);
while (w > myWidth) {
[...]
|
| Prototype: MovieClip.colorFade [Flash 8]MCs stufenloser Colorfade
MovieClip.prototype.colorFade = function(newHEX, speed) {
var myColor = new Color(this);
var cRGB = myColor.getRGB();
var cHEX = cRGB.toString(16);
this.onEnterFrame = function() {
if (cHEX<>ne [...]
|
| Prototype: AddZeros [Flash 8]Nullen hinzufügen für Punktestände
Number.prototype.addZeros = function(p) {
return new Array(p - length(this) + 1).join('0') + this;
};
// oder als Klasse:
Score = function (points) {
this.points = points;
};
Sco [...]
|
| Prototype: Array.unique [Flash 8]Entfernt doppelte Einträge aus einem Array
Array.prototype.unique = function() {
for (var i = 0; i < this.length; i++) {
for (var j = (i + 1); j <= this.length; j++) {
if (this) {
this.splice(j, 1);
}
}
}
};
// Verwenden
[...]
|
| Prototype: MovieClip.Typewriter [Flash 8]Typewriterprototype
typeForm = new TextFormat();
typeForm.color = 0xBABABA;
typeForm.size = 20;
typeForm.font = "euerEMBEDFONT";
//
MovieClip.prototype.typeW = function(mcName, Tiefe, TposX, TposY, TposH, TposW, toType) {
var i = 0;
var j [...]
|
| Prototype: String.replace [Flash 8]Suchen und Ersetzen
String.prototype.replace = function(s, z) {
return unescape(escape(this).split(s).join(z));
};
ASSetPropFlags(String.prototype, "replace", 1, true);
// Verwendung
trace(inhalt = eingabe_txt.text.replace("%0D", "<b [...]
|
| Prototype: String.prestr [Flash 8]Sucht erstes Vorkommen des Suchstring und liefert alles was dvor steht
String.prototype.prestr = function(s) {
if (this.toLowerCase().indexOf(s.toLowerCase()) == -1) {
return false;
} else {
return this.substr(0,this.toLowerCase().indexOf [...]
|
| Prototype: Math.vectorFaceNormal [Flash 8]Flächennormale errechnen
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorFaceNormal (Point1, Point2, Point3)
//+
//+ returns the face normal vector of a plane (or polygon, or face)
//+ described by three [...]
|
| Prototype: Math.vectorCross [Flash 8]Kreuzprodukt zweier Vektoren
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorCross (vector1, vector2)
//+
//+ returns the cross product of the given vectors, that´s another
//+ vector perpendicular to bot [...]
|
| Prototype: Math.vectorDistance [Flash 8]Distanz zwischen 2 Punkten berechnen
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorDistance (startPoint, endPoint)
//+
//+ returns the distance between two points
//++++++++++++++++++++++++++++++++++++++ [...]
|
| Prototype: Math.vectorAngle [Flash 8]Winkel zwischen Vektoren errechnen
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorAngle (vector1, vector2)
//+
//+ returns the angle between two vectors
//+++++++++++++++++++++++++++++++++++++++++++++++++ [...]
|
| Prototype: Math.vectorDot [Flash 8]Skalarprodukt zweier Vektoren
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorDot (vector1, vector2)
//+
//+ returns the dot product of the given vectors - in case of unit
//+ vectors that´s actually the [...]
|
| Prototype: Math.vectorNormalize [Flash 8]Vektor normalisieren
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorNormalize (vector)
//+
//+ returns the normalized vector (that is, a vector of 1 unit length
//+ pointing in the direction of the given [...]
|
| Prototype: Math.vectorLength [Flash 8]Vektorlänge berechnen
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorLength (vector)
//+
//+ returns the length of the vector
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Math [...]
|
| Prototype: Math.vectorDivide [Flash 8]Vektordivision
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorDivide (vector, factor)
//+
//+ returns the vector divided by factor (that is, scales the
//+ length of the vector)
//+++++++++++++++++++++++ [...]
|
| Prototype: Math.vectorMultiply [Flash 8]Vektormultiplikation
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorMultiply (vector, factor)
//+
//+ returns the vector multiplied by factor (that is, scales the
//+ length of the vector)
//++++++++++++ [...]
|
| Prototype: Math.vectorSubtract [Flash 8]Vektorsubtraktion
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorSubtract (startPoint, endPoint)
//+
//+ returns the vector (or path) from start point to end point
//++++++++++++++++++++++++++++++++++++++ [...]
|
| Prototype: Math.vectorAdd [Flash 8]Vektoraddition
/+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorAdd (startPoint, vector)
//+
//+ adds the vector to the start point and returns the resulting
//+ end point (or target point)
//++++++++++++++ [...]
|
| Prototype: Math.pow3 [Flash 8]Wert hoch drei (auch in Flash5)
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.pow3 (value)
//+
//+ returns the 3rd power of given value like Math.pow(value, 3), but
//+ handles value<=0 in Flash5 where built-i [...]
|
| Prototype: Math.pow2 [Flash 8]Wert hoch zwei (auch in Flash5)
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.pow2 (value)
//+
//+ returns the square of given value like Math.pow(value, 2), but
//+ handles value<=0 in Flash5 where built-in f [...]
|
| Prototype: Math.phi [Flash 8]goldenen Schnitt berechnen
Math.phi = function(sum){
var fak = (1 + Math.sqrt(5)) / 2;
var b = sum / fak ;
var a = b / fak;
var arr = ;
return arr;
}
//gibt die beiden Teile eines Wertes im Verhältnis des goldenen Schnittes
//zur [...]
|
| Prototype: Movieclip.atmosphere [Flash 8]Atmosphere - Effekt
MovieClip.prototype.atmosphere = function(pObj, pAnzahl, pBreite, pHoehe) {
for (var i = 0; i<=pAnzahl; i++) {
this.attachMovie(pObj, "flocke"+i, i);
this._x = Math.round(Math.random()*pBreite);
this._y = Math.round(M [...]
|
| Prototype: Movieclip.Schnee [Flash 8]Schnee-Effekt
MovieClip.prototype.schnee = function(pObj,pAnzahl, pBreite, pHoehe) {
for (var i = 0; i<=pAnzahl; i++) {
this.attachMovie(pObj, "flocke"+i, i);
this.skal = 50+(Math.random()*100);
this.alpha = 20+(Math.random()*50);
thi [...]
|
| Prototype: MovieClip.setMatrix [Flash 8]Feldmatrix Effekt Prototype
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++ [...]
| |
Flashhilfe.de Flash Platform Tipps & Tutorials Flash Platform Andere Programmiersprachen Jobangebote Diskussionen
Flashhilfe News
Regeln & Bedingungen
|