Prototype: Array.copy [Flash 8]
| Beiträge: 3099 Wohnort: Saarbrücken Registriert: Jan 2002
| 04.01.2005, 12:02
Kopiert ein Array
Prototype:
ActionScript:1 2 3 4 | Array.prototype.copy = function() {
return this.slice(0, this.length);
}
ASSetPropFlags(Array.prototype,"copy" , 1, true);
|
Beispiel Aufruf:
ActionScript:1 2 3 4 5 6 | erstes_array = [1, 2, 3, 4, 5, 6, 7];
zweites_array = erstes_array.copy();
erstes_array.splice(0,2);
trace("erstes_array = " + erstes_array.join(","));
trace("zweites_array = " + zweites_array.join(","));
|
MfG
Kai Jansen
Flashhilfe-Moderator
http://www.flashhilfe.de
http://www.kaijansen.de
Die Zukunft ist die Vergangenheit von Übermorgen. | |
| Ähnliche Beiträge zum Thema | |
|
Flashhilfe.de Flash Platform Tipps & Tutorials Flash Platform Andere Programmiersprachen Jobangebote Diskussionen
Flashhilfe News 
Regeln & Bedingungen
|