Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 06-08-2003, 20:22   #1 (permalink)
GoToPlay
 
Benutzerbild von mrfreeman12
 
Registriert seit: Apr 2002
Ort: 31...
Beiträge: 106
Question Array.push mit x Elementen???

Abend!

hab eine kleine Frage: kann man einem leeren Array gleich x Elemente zufügen oder ist es nur Schritt für Schritt mit Array.push möglich?

Danke
__________________
Krieg ist Mist! Krieg dem Krieg!
mrfreeman12 ist offline   Mit Zitat antworten
Alt 06-08-2003, 20:48   #2 (permalink)
_//\\#//\\_
 
Benutzerbild von warrantmaster
 
Registriert seit: Jan 2003
Beiträge: 7.060
ActionScript:
  1. a=[];
  2. for(var i=0;i<anzahl;i++){
  3. a.push("hallo"+i);
  4. }
  5. trace(a);

grz
warrantmaster ist offline   Mit Zitat antworten
Alt 06-08-2003, 21:55   #3 (permalink)
filmtip: snatch
 
Registriert seit: Oct 2001
Beiträge: 1.562
alo !

ActionScript:
  1. a=[1,2,3]
  2. b=[4,5,6]
  3. c=a.concat(b)
  4. trace(c)//1,2,3,4,5,6
  5.  


g skyla
Skyla ist offline   Mit Zitat antworten
Alt 06-08-2003, 22:05   #4 (permalink)
nerdig working
 
Benutzerbild von michael
 
Registriert seit: Jul 2001
Ort: Hamburg
Beiträge: 5.832
öhhhm. wie wärs mal mit F1?

Availability

Flash Player 5.

Usage

myArray.push(value,...)

Parameters

value One or more values to append to the array.

Returns

The length of the new array.

Description

Method; adds one or more elements to the end of an array and returns the array's?new length.

Example

The following example creates the array myPets with two elements, cat and dog. The second line adds two elements to the array. After the push method is called, the variable pushed contains four elements. Because the push method returns the new length of the array, the trace action in the last line sends the new length of myPets (4) to the Output window:

myPets = ["cat", "dog"];
pushed = myPets.push("bird", "fish");
trace(pushed);
ActionScript:
  1. a = [1, 2, 3];
  2. a.push (4, 5, 6);
  3. trace (a); //1,2,3,4,5,6
  4.  

Geändert von michael (06-08-2003 um 22:07 Uhr)
michael ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

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



Alle Zeitangaben in WEZ +1. Es ist jetzt 11:34 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele