Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 08-08-2003, 11:34   #1 (permalink)
Neuer User
 
Benutzerbild von apfel007
 
Registriert seit: May 2003
Ort: Hamburg
Beiträge: 161
Ungleich oder Gleich Betriebsblind!??

Moin zusammen !!
Wer kann mir kurz sagen was ich bei dem schnipsel übersehe ?!! Sollte eigentlich nicht so schwer sein ungleich und gleich !

Funzt nur wenn ich Zahlen einsetzte??! Bei Variablen läuft es nicht !!

ActionScript:
  1. trace("yp_ "+this.yp01)//300
  2.             trace("yp_ "+this.yp02);     //300
  3.        
  4.        
  5.           if (this.yp01 != this.yp02){
  6.                 this.Wechsel = 2;       /////// Radius ja
  7.                  this.Wechsel_r = 2;
  8.                  trace( "ungleich "+this.p001);
  9.                  }
  10.                  
  11.          else
  12.          {   //// Entscheidung ob Gerade oder Radius als 1. ausgeführt wird
  13.              this.Wechsel = 1; }         ///// Gerade  ja
  14.  

Hab ich da irgendwo einen Schreibfehler ?

Gruß apfel 007
apfel007 ist offline   Mit Zitat antworten
Alt 08-08-2003, 11:42   #2 (permalink)
Neuer User
 
Registriert seit: Apr 2002
Ort: Vorm PC
Beiträge: 1.583
ActionScript:
  1. if (this.yp01 != this.yp02)
  2.  
  3. //geraten:
  4.  
  5. if (eval("yp_ "+this.yp01) != eval("yp_ "+this.yp02))




Gnut
Gnut ist offline   Mit Zitat antworten
Alt 08-08-2003, 11:50   #3 (permalink)
Neuer User
 
Benutzerbild von apfel007
 
Registriert seit: May 2003
Ort: Hamburg
Beiträge: 161
Danke

Danke für den Tip !
werds mal probieren!

gruß apfel 007
apfel007 ist offline   Mit Zitat antworten
Alt 08-08-2003, 12:06   #4 (permalink)
HAY
Neuer User
 
Benutzerbild von HAY
 
Registriert seit: Aug 2002
Ort: Faust-Stadt
Beiträge: 2.577
verstehe ich nicht. ist doch richtig.
deine variablen heißen doch yp01 und yp02.
oder
__________________
gruß Harry
HAY ist offline   Mit Zitat antworten
Alt 08-08-2003, 12:45   #5 (permalink)
Neuer User
 
Benutzerbild von apfel007
 
Registriert seit: May 2003
Ort: Hamburg
Beiträge: 161
Stimmt

Verstehe ich auch nicht....?! wenn ich die beiden trace gibt es bei beiden den wert 300 !! nur der Vergleich klappt nicht immer !!?
apfel007 ist offline   Mit Zitat antworten
Alt 08-08-2003, 12:57   #6 (permalink)
HAY
Neuer User
 
Benutzerbild von HAY
 
Registriert seit: Aug 2002
Ort: Faust-Stadt
Beiträge: 2.577
ActionScript:
  1. if (this.yp01 != this.yp02){
  2.         this.Wechsel = 2;   
  3.         this.Wechsel_r = 2;
  4.         trace( "ungleich ist "+yp01+" != "+yp02)
  5. }
  6. else
  7. {   
  8.         this.Wechsel = 1;
  9.         trace( "gleich ist "+yp01+" == "+yp02)
  10.         }
geht bei mir immer
__________________
gruß Harry
HAY ist offline   Mit Zitat antworten
Alt 08-08-2003, 13:08   #7 (permalink)
Neuer User
 
Benutzerbild von apfel007
 
Registriert seit: May 2003
Ort: Hamburg
Beiträge: 161
Bei mir sagt dies das 300 ungleich 300 ist ??!!! :-(
Hab mal ein paar zeilen von meinem Rohbau eingefügt, damit das bild klarer wird ...
ActionScript:
  1. movieclip.prototype.makeLine = function(kb01, p01,r01, kb02, p02,r02, kb03, p03,r03, kb04, p04,r04, kb05, p05,r05, sprayin) {
  2.     _root.attachMovie("point", "point"+sprayin, sprayin);
  3.          //////////   X Array
  4.     this.xp01 = kreise[kb01][p01];
  5.     this.xp02 = kreise[kb02][p02];
  6.     this.xp03 = kreise[kb03][p03];
  7.     this.xp04 = kreise[kb04][p04];
  8.     this.xp05 = kreise[kb05][p05];
  9.         this.p001 = p01;
  10.         this.p002 = p02;
  11.         this.p003 = p03;
  12.         this.p004 = p04;
  13.         this.p005 = p05;
  14.         this.p006 = p06;
  15.        
  16.     /////////   Y Array
  17.     this.yp01 = kreise[kb01][++p01];
  18.     this.yp02 = kreise[kb02][++p02];
  19.     this.yp03 = kreise[kb03][++p03];
  20.     this.yp04 = kreise[kb04][++p04];
  21.     this.yp05 = kreise[kb05][++p05];
  22.     trace("________________Deklaration");
  23.     this.baseX = this.xp01;
  24.     this.baseY = this.yp01;
  25.     this.endX01 = this.xp02;
  26.  
  27.     with (this) {
  28.         _root["point"+sprayin]._x = this["xp0" +this.j];
  29.         _root["point"+sprayin]._y = this["yp0" +this.j];
  30.         trace("aha2");
  31.         this.xeff = 2;
  32.         trace("schleife");
  33.         this.speed = 2;
  34.         this.j=1; //// Zähler für X Anfang
  35.         this.k= 2;//// Zähler für X Ende
  36.         this.a= 1; //// Zähler für Angle
  37.      this.Wechsel = 0;
  38.      this.w1 = 2;   // Radius Richtungs weiche Oben-unten
  39.      this.w2 = 2;   // Unten-oben
  40.         lineStyle(1, 16777215, 100);
  41.         moveTo(this["xp0" +this.j], this["yp0" +this.j]);
  42.         this.kb01 = kb01;
  43.         this.kb02 = kb02;
  44.         this.kb03 = kb03;
  45.         this.kb04 = kb04;
  46.         this.kb05 = kb05;
  47.         this.kb06 = kb06;
  48.         this.p01 = p01;
  49.         this.p02 = p02;
  50.         this.p03 = p03;
  51.         this.p04 = p04;
  52.         this.p05 = p05;
  53.         this.p06 = p06;
  54.         this.p001 ;
  55.         this.p002;
  56.         this.p003 ;
  57.         this.p004 ;
  58.         this.p005;
  59.         this.p006;
  60.         this.r01 = r01;
  61.         this.r02 = r02;
  62.         this.r03 = r03;
  63.         this.r04 = r04;
  64.         this.r05 = r05;
  65.         this.r06 = r06;
  66.         this.Angle01;
  67.         this.startw;
  68.         this.wende;
  69.         this.richtungS = 0;
  70.         this.Wechsel_G = 2/// ------>>>>>>Anfangswert !!!!!!!
  71. /////////     Hier is die Abfrage !!????!
  72.             trace("_______________yp_>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> "+this.yp01);
  73.             trace("_______________yp_>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> "+this.yp02);////
  74.                   if (this.yp01 != this.yp02){
  75.                    this.Wechsel = 2;       /////// Radius ja
  76.                  this.Wechsel_r = 2;
  77.                  trace( "ungleich ist "+yp01+" != "+yp02)
  78.                  }
  79.                      else if (this.testy == 300)
  80.          { 
  81.              this.Wechsel = 1;
  82.               trace( "GGGLEICH "+this.p001);}         ///// Gerade  ja
  83.             
  84.        
  85.             };
  86.              this.onEnterFrame = function() {.......
  87. };
apfel007 ist offline   Mit Zitat antworten
Alt 08-08-2003, 13:11   #8 (permalink)
Definitionssache
 
Benutzerbild von dburucu
 
Registriert seit: Apr 2003
Ort: Braunschweig
Beiträge: 2.433
hilft das vielleicht????


.....
if (Number(this.yp01) != Number(this.yp02)){
.....



oder besser

....
this.yp01 = Number(kreise[kb01][++p01]);
this.yp02 = Number(kreise[kb02][++p02]);
....

manchmal ist bei Flash eben unerklärliche Sachen ....
dburucu ist offline   Mit Zitat antworten
Alt 08-08-2003, 13:13   #9 (permalink)
Neuer User
 
Benutzerbild von apfel007
 
Registriert seit: May 2003
Ort: Hamburg
Beiträge: 161
Verschrieben !?

else if (this.testy == 300)
{
this.Wechsel = 1;
trace( "GGGLEICH "+this.p001);} ///// Gerade ja
soll

else
{
this.Wechsel = 1;
trace( "GGGLEICH "+this.p001);} ///// Gerade ja
apfel007 ist offline   Mit Zitat antworten
Alt 08-08-2003, 13:17   #10 (permalink)
Neuer User
 
Benutzerbild von apfel007
 
Registriert seit: May 2003
Ort: Hamburg
Beiträge: 161
Noch was

wenn ich die Sache mit anderen Werten aufrufe.. dann funztzt

zB 61,137..
apfel007 ist offline   Mit Zitat antworten
Alt 08-08-2003, 13:45   #11 (permalink)
Neuer User
 
Benutzerbild von apfel007
 
Registriert seit: May 2003
Ort: Hamburg
Beiträge: 161
Number

Hi dburucu!
Mit Number hat leider auch nichts gebracht !
apfel007 ist offline   Mit Zitat antworten
Alt 08-08-2003, 14:23   #12 (permalink)
Neuer User
 
Benutzerbild von K-Grabowski
 
Registriert seit: Jan 2003
Ort: Arminia!!!! Bielefeld
Beiträge: 1.138
warum benutzt du with(this) um danach trotzdem immer wieder this zu schreiben, könnte mir vorstellen das dein Fehler mit deinem with zu tun hat.
__________________
Wieviel hätte ich also für dieses Fahrzeug zu investieren???
K-Grabowski ist offline   Mit Zitat antworten
Alt 08-08-2003, 18:11   #13 (permalink)
Neuer User
 
Benutzerbild von apfel007
 
Registriert seit: May 2003
Ort: Hamburg
Beiträge: 161
und wie soll ich das ohne with anstellen ??
apfel007 ist offline   Mit Zitat antworten
Alt 08-08-2003, 18:22   #14 (permalink)
Neuer User
 
Benutzerbild von K-Grabowski
 
Registriert seit: Jan 2003
Ort: Arminia!!!! Bielefeld
Beiträge: 1.138
ActionScript:
  1. movieclip.prototype.makeLine = function(kb01, p01,r01, kb02, p02,r02, kb03, p03,r03, kb04, p04,r04, kb05, p05,r05, sprayin) {
  2.         _root.attachMovie("point", "point"+sprayin, sprayin);
  3.         //////////   X Array
  4.         this.xp01 = kreise[kb01][p01];
  5.         this.xp02 = kreise[kb02][p02];
  6.         this.xp03 = kreise[kb03][p03];
  7.         this.xp04 = kreise[kb04][p04];
  8.         this.xp05 = kreise[kb05][p05];
  9.         this.p001 = p01;
  10.         this.p002 = p02;
  11.         this.p003 = p03;
  12.         this.p004 = p04;
  13.         this.p005 = p05;
  14.         this.p006 = p06;
  15.        
  16.         /////////   Y Array
  17.         this.yp01 = kreise[kb01][++p01];
  18.         this.yp02 = kreise[kb02][++p02];
  19.         this.yp03 = kreise[kb03][++p03];
  20.         this.yp04 = kreise[kb04][++p04];
  21.         this.yp05 = kreise[kb05][++p05];
  22.         trace("________________Deklaration");
  23.         this.baseX = this.xp01;
  24.         this.baseY = this.yp01;
  25.         this.endX01 = this.xp02;
  26.        
  27.        
  28.                 _root["point"+sprayin]._x = this["xp0" +this.j];
  29.                 _root["point"+sprayin]._y = this["yp0" +this.j];
  30.                 trace("aha2");
  31.                 this.xeff = 2;
  32.                 trace("schleife");
  33.                 this.speed = 2;
  34.                 this.j=1; //// Zähler für X Anfang
  35.                 this.k= 2;//// Zähler für X Ende
  36.                 this.a= 1; //// Zähler für Angle
  37.                 this.Wechsel = 0;
  38.                 this.w1 = 2;   // Radius Richtungs weiche Oben-unten
  39.                 this.w2 = 2;   // Unten-oben
  40.                 this.lineStyle(1, 16777215, 100);
  41.                 this.moveTo(this["xp0" +this.j], this["yp0" +this.j]);
  42.                 this.kb01 = kb01;
  43.                 this.kb02 = kb02;
  44.                 this.kb03 = kb03;
  45.                 this.kb04 = kb04;
  46.                 this.kb05 = kb05;
  47.                 this.kb06 = kb06;
  48.                 this.p01 = p01;
  49.                 this.p02 = p02;
  50.                 this.p03 = p03;
  51.                 this.p04 = p04;
  52.                 this.p05 = p05;
  53.                 this.p06 = p06;
  54.                 this.p001 ;
  55.                 this.p002;
  56.                 this.p003 ;
  57.                 this.p004 ;
  58.                 this.p005;
  59.                 this.p006;
  60.                 this.r01 = r01;
  61.                 this.r02 = r02;
  62.                 this.r03 = r03;
  63.                 this.r04 = r04;
  64.                 this.r05 = r05;
  65.                 this.r06 = r06;
  66.                 this.Angle01;
  67.                 this.startw;
  68.                 this.wende;
  69.                 this.richtungS = 0;
  70.                 this.Wechsel_G = 2/// ------>>>>>>Anfangswert !!!!!!!
  71.                 /////////     Hier is die Abfrage !!????!
  72.                 trace("_______________yp_>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> "+this.yp01);
  73.                 trace("_______________yp_>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> "+this.yp02);////
  74.                 if (this.yp01 != this.yp02){
  75.                         this.Wechsel = 2;       /////// Radius ja
  76.                         this.Wechsel_r = 2;
  77.                         trace( "ungleich ist "+yp01+" != "+yp02)
  78.                 }
  79.                 else if (this.testy == 300)
  80.                 {
  81.                         this.Wechsel = 1;
  82.                         trace( "GGGLEICH "+this.p001);}         ///// Gerade  ja
  83.                
  84.                
  85.      
  86.         this.onEnterFrame = function() {.......
  87.         };

lediglich soweit ich durchsteige...warum hast du überhaupt with benutzt?? wegen lineStyle und moveTo ???
__________________
Wieviel hätte ich also für dieses Fahrzeug zu investieren???

Geändert von K-Grabowski (08-08-2003 um 18:24 Uhr)
K-Grabowski ist offline   Mit Zitat antworten
Alt 08-08-2003, 21:04   #15 (permalink)
Neuer User
 
Benutzerbild von apfel007
 
Registriert seit: May 2003
Ort: Hamburg
Beiträge: 161
with

danke für Deinen Support...
with - habe genommen, weil es im Script stand, welches ich als Grundlage genommen habe....
Du hast es einfach weggelassen ?! ich habe da einfach nicht so den Durchblick.. bin sonst eher auf der kreativen Seite tätig.!

Ich mußte oder habe die ganzen this Variablen deklariert, weil ich diese in prototype Funktionen benutzen will, die in onEnterFrame aufgerufen werden .
Habe schon versucht, die Liste zu verkürzen mit ..

for (i = 1; i<=6; ++i){

this["xp0" +this.i];
...
...
}
hat aber gar nicht gefunzt?!!

zu !=

habe gelesen, dass es zuweilen zu Rundungsfehlern kommt?!
Kann man alle Kommastellen bestimmt abschneiden ?
Habe mal Math.floor probiert .. hat aber auch nichts gebracht ??

die beiden werte wollen einfach nicht ungleich werden, obwohl beim tracen bei beiden 300 rauskommt ?!!

gruß apfel 007
apfel007 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 08:01 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele