Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 25-12-2003, 17:27   #1 (permalink)
Neuer User
 
Registriert seit: Jan 2002
Beiträge: 1.244
if und rollOver

hi,
und einen Frohes Fest.

Habe da ein Prob.

Unten sind scriptschnipsel. Ich hoffe es reicht aus.
Es geht darum:
Es sind 9 Bilder auf _x nebeneinander angeordnet.
Wenn ich mit der Mouse in der Mitte bin(wo auch ein Bild ist), wird "v" gleich null gesetzt.
Es wird jetzt die If "if (v === 0)"{ ausgeführt. trace gibt mir:
mitte
onRollOver
aus. Bis jetzt noch richtig.
Bewege ich jetzt die Mouse auf ein Bild außerhalb der Mitte,
gibt mir trace : onRollOver aus, obwohl "v != 0 ist" ??

wenn ich den Film neu starte, geht es, aber nur solange, bis ich einmal wieder in der mitte war.

Kennt jemand das Problem ???


ActionScript:
  1. stop ();
  2.  
  3. for (i = 1; i <= anzahl; i++) {
  4.     _root.attachMovie ("cont", "cont" + i, i);
  5.     .
  6.     .
  7.     _root["cont" + i].loadMovie ("mc_" + i + ".jpg");
  8.     .
  9.     .
  10.    
  11. }
  12.  
  13. onEnterFrame = function () {
  14.     if (_xmouse > (x_pos_mitte - 10) && _xmouse < (x_pos_mitte + 10)) {
  15.         var v = 0;
  16.         trace ("mitte");
  17.     }
  18.    
  19.     for (i = 1; i <= anzahl; i++) {
  20.         _root["cont" + i]._x += v;
  21.  
  22.  
  23.        
  24.         if (v === 0){
  25.  
  26.  
  27.        
  28.         _root["cont" + i].onRollOver = function () {
  29.         trace ("onRollOver");
  30.             .
  31.             .
  32.             .
  33.         };
  34.         }// if end
  35.         _root["cont" + i].onRollOut = function () {
  36.             .
  37.             .
  38.             .
  39.         };
  40.        
  41.     }// for end
  42.    
  43. };
__________________
Mfg aus Brandenburg.

harego

Spiel

Zur Page
harego ist offline   Mit Zitat antworten
Alt 25-12-2003, 17:49   #2 (permalink)
helpQLODhelp
 
Benutzerbild von bokel
 
Registriert seit: Feb 2002
Ort: Köln
Beiträge: 8.505
Frohe Weihnachten auch dir.
Übicherweise werden die Handler für onRollOver und -Out einmal am Anfang zugewiesen.
Hat es einen besonderen Grund, dass du das in der onEnterFrame-Schleife machst ?

mfg r.
bokel ist offline   Mit Zitat antworten
Alt 25-12-2003, 17:56   #3 (permalink)
Neuer User
 
Registriert seit: Jan 2002
Beiträge: 1.244
Naja, mit dem onEnterFrame frage ich ja die Mouse-Position ab.
Und wenn sie in der Mitte ist, soll auch das onRollOver erst ausgeführt
werden können.
__________________
Mfg aus Brandenburg.

harego

Spiel

Zur Page
harego ist offline   Mit Zitat antworten
Alt 25-12-2003, 18:09   #4 (permalink)
Neuer User
 
Registriert seit: Jan 2002
Beiträge: 1.244
hi, und Danke bokel !

Habe es hinbekommen. Die If abfrage hinter der onRollOver !!!

ActionScript:
  1. if (v === 0){
  2.                        
  3.                        
  4.                        
  5.                         _root["cont" + i].onRollOver = function () {
  6.                                   if (v === 0){
  7.                                 trace ("onRollOver");
__________________
Mfg aus Brandenburg.

harego

Spiel

Zur Page
harego 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 15:43 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele