Thema: Prototype
Beiträge zum Thema "Prototype"
| Prototype: Array.maxLength [Flash 8]Länge des Arrays auf nr kürzen
Array.prototype.maxLength = function(i) {
if(i>0 && this.length>i) this.pop(), this.maxLength(i);
else if(i<0 && this.length>i*-1) this.shift(), this.maxLength(i);
}
;
ary.maxLength(4);
trace(ary); // a,b,c [...]
|
| Prototype: SharedObject.destroy [Flash 8]SharedObject löschen
// http://www.flashguru.co.uk
SharedObject.destroy = function(name){
var so = SharedObject.getLocal(name);
for(var i in so.data){
delete so.data;
}
so.flush();
}
|
| Prototype: Array.findRemove [Flash 8]Eintrag suchen und entfernen!
Array.prototype.findRemove = function(removeEntry) {
return this.toString().split(removeEntry + ",").join("").split(",");
};
// Verwenden
liste = ;
liste = liste.findRemove("Matze");
trace(liste [...]
|
| Prototype: attachAbove / attachUnder [Flash 8]Tiefenmanagement der einfachen Art
/*
*
* COPYRIGHT MAX KLATTE, NUR FÜR NICHT KOMMERZIELLE NUTZUNG! (ansonten rücksprache);
*
* Diese Funtkion erleichtert ein "Tiefenmanegment" ohne den gebrauch von leveln.
* So wird auch Beispielsweise das [...]
|
| Prototype: MovieClip.onDoubleClick [Flash 8]Event Handler - Doppelklick
MovieClip.prototype.addProperty("onDoubleClick",function() {
return this.$onDoubleClick;
},function(f) {
this.__proto__ = DoubleClick.prototype;
this.$onDoubleClick = f;
ASSetPropFlags(this,,1,true);
}); [...]
|
| Prototype: Key.onShiftDown / onShiftUp [Flash 8] Globaler Event Handler für die Shift-Taste
// onSHIFTDown/Up - Inspired by Sebastian
// Durch das _global Objekt wird das ganze Zeitleisten
// unabhängig und zu einem Konstanten Event Handler
// Hinweis: Lässt sich beliebig auf weitere Taste [...]
|
| Prototype: Movieclip.simpleCircle [Flash 8]Einfacher Kreis mit lineTo()
// Der Trick funtzt prima das lineTo() zu missbrauchen.
// Die Untergrenze für die Verschiebung liegt bei
// 0.14999999999999999.
MovieClip.prototype.simpleCircle = function(pobj, ptiefe, pX, pY, pDicke, pFarbe, pDe [...]
|
| Prototype: String.removeHTML [Flash 8]Entfernt HTML Tags aus einem String
String.prototype.removeHTML = function() {
var temp = "", s;
while((s=this.indexOf("<"))!=-1) {
temp += this.substr(0,s);
this = this.substr(this.indexOf(">")+1);
}
return temp+this;
};
ASSetP [...]
|
| Prototype: String.trim [Flash 8]Schneidet Leerzeichen und Steuerzeichen vor und hinter einem String ab.
String.prototype.trim = function() {
for (var i = 0; this.charCodeAt(i)<33; i++);
for (var j = this.length-1; this.charCodeAt(j)<33; j--);
return this.substring(i, j+1);
[...]
|
| Prototype: Array.lastIndexOf() [Flash 8]Gibt den letzten vorkommenden Index aus einem Array zurück.
Array.prototype.lastIndexOf = function (s) {
var index = -1;
for (var i in this) {
if (this == s) {
index = i;
break;
}
}
index = (isNaN(index)) ? index : Number(ind [...]
|
| Prototype: Mouse.onDoubleClick [Flash 8]Event Handler - Doppelklick
dCListener = {};
dCListener.onMouseDown = function() {(t = getTimer()) < $a+250 ? Mouse.broadcastMessage("onDoubleClick") : $a = t;}
Mouse.addListener(dCListener);
ASBroadcaster.initialize(dCListener);
ASSetPropFlag [...]
|
| Prototype: transform [Flash 8]Eventgesteuerte Animation
MovieClip.prototype.transform = function( $tobj , $ref) {
//lokal ablegen
this.$tobj = $tobj;
this.$ref = $ref;
//transformieren
this.onEnterFrame = function() {
var count = 0;
for (var prop in this.$tobj) [...]
|
| Prototype: Movieclip.totalAction [Flash 8]Sämtliche MovieClips auf einmal Steuern
Movieclip.prototype.totalAction = function(op,val) {
this(val);
for (var i in this) {
if (typeof (this) == "movieclip") {
this.totalAction(op,val);
}
}
};
// Verwenden
this.totalAction [...]
|
| Prototype: String.wordwrap [Flash 8]Bricht die Zeilen nach einer bestimmten Anzahl mittels angegebenen Zeichen um
String.prototype.wordwrap = function(nr,br,cut) {
var i, l, nr=(!nr ? 75 : nr), temp="", laenge=Math.floor(this.length/nr), br=(br==undefined ? "\n" : br);
for(i=0;i< [...]
|
| Prototype: String.ucfirst [Flash 8]Setzt das erste Zeichen eines Strings als Großbuchstabe um
String.prototype.ucfirst = function() {
return this.charAt(0).toUpperCase()+this.substr(1);
}
ASSetPropFlags(String.prototype,"ucfirst",1,true);
|
| Prototype: String.strrchr [Flash 8]Sucht letztes Vorkommen des gesuchten Zeichens und liefert den Reststring
String.prototype.strrchr = function(s) {
var temp;
if((temp = this.toLowerCase().lastIndexOf(s.toLowerCase())) == -1) return false;
return this.substr(temp);
}
ASSetP [...]
|
| Prototype: String.stristr [Flash 8]Sucht erstes Vorkommen des Suchstrings und liefert den Reststring
// Wie String.strstr, aber ohne Rücksicht auf Groß- bzw. Kleinschreibung
// String.strstr -> http://www.flashhilfe.de/go/prototype/lesen&id=24&kat=21
String.prototype.stristr [...]
|
| Prototype: String.strstr [Flash 8]Sucht erstes Vorkommen des Suchstrings und liefert den Reststring
String.prototype.strstr = function(s) {
var temp
if((temp = this.indexOf(s)) == -1) return false;
return this.substr(temp);
}
ASSetPropFlags(String.prototype,"strstr", [...]
|
| Prototype: String.repeat [Flash 8]Wiederholt eine String-Ausgabe
// Inspired by Madokan
// http://www.flashhilfe.de/go/prototype/lesen&kat=16&seite=0&id=11
String.prototype.repeat = function(nr) {
return new Array(nr+1).join(this);
}
ASSetPropFlags(String.prototype,"repeat [...]
|
| Prototype: String.reverse [Flash 8]Liefert einen String in umgekehrter Reihenfolge
String.prototype.reverse = function() {
return this.split("").reverse().join("");
}
ASSetPropFlags(String.prototype,"reverse",1,true);
|
| Prototype: String.uniqid [Flash 8]Erstellt eine eindeutige ID
Array.prototype.find = function(eingabe) {
return (this.toString().split(eingabe).length > 1);
}
String.uniqid = function(nr) {
var str = "", b = "";
for(var i=0;i<nr;i++) {
b = random(36).toString(36);
[...]
|
| Prototype: Array.find [Flash 8]Findet Eintrag im Array und gibt true zurück
Array.prototype.find = function(eingabe) {
for(var i in this) if(this === eingabe) return true;
return false;
}
ASSetPropFlags(Array.prototype,"find",1,true);
;
trace(test_ary.find("Fr 02.0 [...]
|
| Prototype: String.replace [Flash 8]Suchen und ersetzen
// #########################
// Für Flash MX:
// #########################
String.prototype.replace = function (s, j) {
return this.split(s).join(j);
}
ASSetPropFlags(String.prototype,"replace",1,true);
// #### [...]
|
| Prototype: String.toArray [Flash 8]Text in Array umwandeln
// Inspired by Madokan
String.prototype.toArray = function() {
return this.split("");
};
ASSetPropFlags(String.prototype,"toArray",1,true);
// Zuweisung
text = "flashhilfe.de";
liste = text.toArray();
[...]
|
| Prototype: TextField.checkEmail [Flash 8]Email Adresse überprüfen
/*#####################################*/
/* Email - Check | Flash MX | 2003 */
/* Sebastian Wichmann */
/* Michael Holl (Holly) */
/* http://www.flashhilfe.de */
/ [...]
| |
Flashhilfe.de Flash Platform Tipps & Tutorials Flash Platform Andere Programmiersprachen Jobangebote Diskussionen
Flashhilfe News
Regeln & Bedingungen
|