Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 03-08-2004, 21:06   #1 (permalink)
bitchboy
 
Registriert seit: Mar 2004
Ort: München
Beiträge: 126
Unhappy array - wie schreibt man das richtig?

hi,

ich sitz seit heute morgen um halb 9 an nem space taxi clon. scheinbar peil ich inzwischen aber gar nix mehr

wie schreibt man das hier denn richtig:
erst das array (was wohl stimmt):
Code:
aneckpunkte = new Array(_root.rand_links, _root.rand_rechts, _root.rand_oben_rechts, _root.rand_oben_links, _root.rand_unten, _root.landeflaeche1, _root.landeflaeche2, _root.landeflaeche3);
und dann die kollisionsabfrage, mit einem der objekte im array:
Code:
if (this.hitTest(aneckpunkte)) {
     _root.kaputt = true;
}
wie schreib ich denn den hittest? bzw. genauer gesagt: wie schreib ich das array richtig in die klammer?

thx & cheers,
alex
__________________
cheers,
alex
---
http://www.destinationdesign.de
Trumpfass ist offline   Mit Zitat antworten
Alt 03-08-2004, 21:25   #2 (permalink)
mod_rewrite
 
Benutzerbild von sonar
 
Registriert seit: Feb 2003
Ort: München
Beiträge: 15.621
Brauchst ne Schleife, die durch dein Array läuft.
ActionScript:
  1. for(var i in aneckpunkte) {
  2.   if (this.hitTest(aneckpunkte[i])) {
  3.      _root.kaputt = true;
  4.   }
  5. }
__________________
RTFM
Wie man Fragen richtig stellt.

Achim Bindannmalweg

Money makes the world go round, fear makes it turn much faster.
(New Model Army)
sonar ist offline   Mit Zitat antworten
Alt 03-08-2004, 21:37   #3 (permalink)
Achim Math.PI
 
Benutzerbild von bloba
 
Registriert seit: Jul 2001
Ort: cool Colonia
Beiträge: 11.642
oder
ActionScript:
  1. for(var i =0; i<aneckpunkte.length;i++) {
  2.   if (this.hitTest(aneckpunkte[i])) {
  3.      _root.kaputt = true;
  4.   }
  5. }
__________________
gruß bloba

2 x onkel² b_d
bloba ist offline   Mit Zitat antworten
Alt 03-08-2004, 21:49   #4 (permalink)
mod_rewrite
 
Benutzerbild von sonar
 
Registriert seit: Feb 2003
Ort: München
Beiträge: 15.621
Kommt aufs gleiche raus, ich meine allerdings, mich zu erinnern, dass eine for...in-Schleife im Zweifelsfall schneller is...

Hi bloba
__________________
RTFM
Wie man Fragen richtig stellt.

Achim Bindannmalweg

Money makes the world go round, fear makes it turn much faster.
(New Model Army)
sonar ist offline   Mit Zitat antworten
Alt 03-08-2004, 22:09   #5 (permalink)
bitchboy
 
Registriert seit: Mar 2004
Ort: München
Beiträge: 126
super, danke
__________________
cheers,
alex
---
http://www.destinationdesign.de
Trumpfass ist offline   Mit Zitat antworten
Alt 03-08-2004, 22:11   #6 (permalink)
Achim Math.PI
 
Benutzerbild von bloba
 
Registriert seit: Jul 2001
Ort: cool Colonia
Beiträge: 11.642
gern geshen, ich glaub kaum dass das einer merkt
__________________
gruß bloba

2 x onkel² b_d
bloba 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 12:44 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele