Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 22-10-2005, 17:01   #1 (permalink)
Ein Reisender...
 
Benutzerbild von Syracus
 
Registriert seit: May 2004
Beiträge: 105
Keine Repetition

Ich habe das Problem, dass ich eine Schleife fahren muss um die Mausposition abzufragen. Doch die Ereignisse sollen nicht immer und immer wieder abgespielt werden, sondern nur einmal...

Siehe:
ActionScript:
  1. // MOUSE FUNK
  2. onEnterFrame = function() {
  3.     if (_root._xmouse < _200 and _root._xmouse > 10
  4.     and _root._ymouse < 200 and _root._ymouse >10 ) { 
  5.    
  6.     this.TXTSPLASHMENU.gotoAndPlay(46); //Da wird immer
  7. //nur der erste Frame gespielt wegen der Wiederholung!
  8. //Ich will aber nur einmal abspielen...
  9.  
  10.     } else {
  11.  
  12.         this.TXTSPLASHMENU.gotoAndPlay(1); //hier auch!
  13.  
  14.         }
  15.  
  16. } // END MOUSE FUNK
  17.  

Wie kann ich machen, dass SOLANGE die Maus AUSSERHALB ist, das gotoAndPlay 1mal!! gefahren wird ohne sich zu wiederholen? Gibts sowas wie end();?

Gruss Syra
__________________
Handle so, dass die Maxime Deines Willens als Gesetzgebung gilt :o)

Geändert von Syracus (22-10-2005 um 17:09 Uhr)
Syracus ist offline   Mit Zitat antworten
Alt 22-10-2005, 17:12   #2 (permalink)
voidboy
 
Benutzerbild von rendner[i]
 
Registriert seit: Sep 2004
Ort: München
Beiträge: 5.588
So könnte man es machen:
PHP-Code:
// MOUSE FUNK
this.onEnterFrame = function() {
    
    
        if ( 
_root._xmouse < (_root.WHITE._x _root.WHITE._width)  && _root._xmouse _root.WHITE._x &&
             
_root._ymouse < (_root.WHITE._y _root.WHITE._height) && _root._ymouse _root.WHITE._y 
        {
            if ( 
this.!= )
            {
                
this.TXTSPLASHMENU.gotoAndPlay(46); 
                
this.1
            }
        }
    
    else
    {
        if ( 
this.!= )
        {
            
this.TXTSPLASHMENU.gotoAndPlay(1); //hier auch!
            
this.2;     
        }
    }
        
// END MOUSE FUNK 
__________________
ERROR: Signature is too large
rendner[i] ist offline   Mit Zitat antworten
Alt 22-10-2005, 17:13   #3 (permalink)
Meep!
 
Registriert seit: Sep 2005
Beiträge: 146
Zitat:
Zitat von Syracus
Ich habe das Problem, dass ich eine Schleife fahren muss um die Mausposition abzufragen. Doch die Ereignisse sollen nicht immer und immer wieder abgespielt werden, sondern nur einmal...

Siehe:
ActionScript:
  1. // MOUSE FUNK
  2. onEnterFrame = function() {
  3.     if (_root._xmouse < _200 and _root._xmouse > 10
  4.     and _root._ymouse < 200 and _root._ymouse >10 ) { 
  5.    
  6.     this.TXTSPLASHMENU.gotoAndPlay(46); //Da wird immer
  7. //nur der erste Frame gespielt wegen der Wiederholung!
  8. //Ich will aber nur einmal abspielen...
  9.  
  10.     } else {
  11.  
  12.         this.TXTSPLASHMENU.gotoAndPlay(1); //hier auch!
  13.  
  14.         }
  15.  
  16. } // END MOUSE FUNK
  17.  

Wie kann ich machen, dass SOLANGE die Maus AUSSERHALB ist, das gotoAndPlay 1mal!! gefahren wird ohne sich zu wiederholen? Gibts sowas wie end();?

Gruss Syra
bin mir nich sicher
ActionScript:
  1. // MOUSE FUNK
  2. movieclip.x = 0;
  3. movieclip.y = 0;
  4. onEnterFrame = function() {
  5.     if (_root._xmouse < _200 and _root._xmouse > 10
  6.     and _root._ymouse < 200 and _root._ymouse >10 ) { 
  7.    
  8.     this.TXTSPLASHMENU.gotoAndPlay(46);
  9. this.x = 0;
  10.     } else {
  11.  
  12.         this.TXTSPLASHMENU.gotoAndPlay(1);
  13. this.y = 0;
  14.         }
  15. this.x<1?this.TXTSPLASHMENU.gotoAndPlay(46):0;
  16. this.y<1?this.TXTSPLASHMENU.gotoAndPlay(1):0;
  17. this.x = 1;
  18. this.y = 1;
  19.  
  20. } // END MOUSE FUNK
  21.  

Geändert von pixartist (22-10-2005 um 17:14 Uhr)
pixartist ist offline   Mit Zitat antworten
Alt 22-10-2005, 17:19   #4 (permalink)
voidboy
 
Benutzerbild von rendner[i]
 
Registriert seit: Sep 2004
Ort: München
Beiträge: 5.588
Zitat:
Zitat von pixartist
bin mir nich sicher
ActionScript:
  1. // MOUSE FUNK
  2. movieclip.x = 0;
  3. movieclip.y = 0;
  4. onEnterFrame = function() {
  5.     if (_root._xmouse < _200 and _root._xmouse > 10
  6.     and _root._ymouse < 200 and _root._ymouse >10 ) { 
  7.    
  8.     this.TXTSPLASHMENU.gotoAndPlay(46);
  9. this.x = 0;
  10.     } else {
  11.  
  12.         this.TXTSPLASHMENU.gotoAndPlay(1);
  13. this.y = 0;
  14.         }
  15. this.x<1?this.TXTSPLASHMENU.gotoAndPlay(46):0;
  16. this.y<1?this.TXTSPLASHMENU.gotoAndPlay(1):0;
  17. this.x = 1;
  18. this.y = 1;
  19.  
  20. } // END MOUSE FUNK
  21.  
Funktioniert so jedenfalls nicht, da er immer in den if oder else geht dann x und y gleich 0 setzt und dann weiter unten deine Abfrage den gotoAndStop wieder ausführt.
__________________
ERROR: Signature is too large
rendner[i] ist offline   Mit Zitat antworten
Alt 22-10-2005, 17:20   #5 (permalink)
Ein Reisender...
 
Benutzerbild von Syracus
 
Registriert seit: May 2004
Beiträge: 105
Perfekt!

Danke Jungs, wieder was gelernt und läuft wie ne eins!!

Topic closed!

Gruss Syra
__________________
Handle so, dass die Maxime Deines Willens als Gesetzgebung gilt :o)
Syracus 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 18:20 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele