Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 06-04-2004, 15:33   #1 (permalink)
Neuer User
 
Benutzerbild von _Max_
 
Registriert seit: May 2003
Beiträge: 2.475
Simples AS-Menu zum erlernen

hi leude

ich habe mich jetzt mal an AS ran gemacht....das heisst,ich bin totaler anfänger.

so dachte mir dann mal,ich mnache nen kleines menu,nur so zum üben.aber schon klappt was nicht


ich weiss nicht wieso es nicht geht deswegen frage ich mal euch.

die idee war:


wenn ich über den ersten mc (mc1) fahre,dann solln die andren runter fahren.wenn ich dann aber wieder vom mc1 wegrolle,solln die andren mc's wieder zu ihrem anfang FAHREN

ActionScript:
  1. function anfang() {
  2.     trace(mc1._y);
  3.     anfangx = mc1._y;
  4. }
  5.  
  6. anfang();
  7. mc1.onRollOver = function() {
  8.     mc2.onEnterFrame = function() {
  9.         this._y += 4;
  10.     };
  11.     mc3.onEnterFrame = function() {
  12.         this._y += 4;
  13.     };
  14.     mc4.onEnterFrame = function() {
  15.         this._y += 4;
  16.     };
  17. };
  18.  
  19. mc1.onRollOut = function() {
  20.     mc2.onEnterFrame = function() {
  21.         this._y -= 4;
  22.         if (mc2._y == anfangx) {
  23.             delete this.onEnterFrame;
  24.         }
  25.     };
  26.     mc3.onEnterFrame = function() {
  27.         this._y -= 4;
  28.         if (mc3._y == anfangx) {
  29.             delete this.onEnterFrame;
  30.         }
  31.     };
  32.     mc4.onEnterFrame = function() {
  33.         this._y -= 4;
  34.         if (mc4._y == anfangx) {
  35.             delete this.onEnterFrame;
  36.         }
  37.     };
  38. };


maxi
__________________
!!! www.verblitzt.de !!!
_Max_ ist offline   Mit Zitat antworten
Alt 06-04-2004, 15:46   #2 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Befinden sich respt. sollen in die mc's noch untermenues rein!?
Dann ist der ansatz nicht ganz richtig!
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 06-04-2004, 15:50   #3 (permalink)
Neuer User
 
Benutzerbild von _Max_
 
Registriert seit: May 2003
Beiträge: 2.475
ne,die mc's ( mc2,mc3 und mc4) solln einfach nur mal runner huschen un dann wieder hoch ( eben bei rollover un rollout)
__________________
!!! www.verblitzt.de !!!
_Max_ ist offline   Mit Zitat antworten
Alt 06-04-2004, 15:54   #4 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Schau mal hierrein da hab ich sowas gepostet!!
enterFrame(): script Problem
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 06-04-2004, 15:57   #5 (permalink)
Neuer User
 
Benutzerbild von _Max_
 
Registriert seit: May 2003
Beiträge: 2.475
ja das is super
aber ich will ja lernen,und deswegen würde ich das gerne mit meinem script machen...
__________________
!!! www.verblitzt.de !!!
_Max_ ist offline   Mit Zitat antworten
Alt 06-04-2004, 16:06   #6 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Außer das des a bissrl umstaändlich ist kann ich keinen fehler finden!!
Was geht den nicht nach Deiner Meinung!?
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 06-04-2004, 16:08   #7 (permalink)
Neuer User
 
Benutzerbild von _Max_
 
Registriert seit: May 2003
Beiträge: 2.475
also,die letzten 2 mc's fahren einfach weiter nach unten.

dh: wenn ich auf mc1 rolle,fahren alle schön nach unten,doch wenn ich wieder runter gehe vom mc1,fahren die letzten 2 weiter,nur der 2 fährt auf seinen anfangspunkt.
__________________
!!! www.verblitzt.de !!!
_Max_ ist offline   Mit Zitat antworten
Alt 06-04-2004, 16:11   #8 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Habs schnell nachgebaut, bei mir fahren alle ordentlich zurück!?
Sind die auf unterschiedlichen _y Koordinaten!
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 06-04-2004, 16:14   #9 (permalink)
Neuer User
 
Benutzerbild von _Max_
 
Registriert seit: May 2003
Beiträge: 2.475
ja doch schon lol ich weiss es nicht
__________________
!!! www.verblitzt.de !!!
_Max_ ist offline   Mit Zitat antworten
Alt 06-04-2004, 16:21   #10 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Guckst DU!!
Angehängte Dateien
Dateityp: zip sonc.zip (2,2 KB, 5x aufgerufen)
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 06-04-2004, 16:22   #11 (permalink)
Neuer User
 
Benutzerbild von _Max_
 
Registriert seit: May 2003
Beiträge: 2.475
ich verstehe das nicht.bei mir halten die einfach nicht an....
__________________
!!! www.verblitzt.de !!!
_Max_ ist offline   Mit Zitat antworten
Alt 06-04-2004, 16:23   #12 (permalink)
Neuer User
 
Benutzerbild von _Max_
 
Registriert seit: May 2003
Beiträge: 2.475
hihi danke


nochwas.wie mache ich das,dass die BTN nur bis zu nem bestimmten punkt fahren solln,und dann STOPPEN solln.
__________________
!!! www.verblitzt.de !!!
_Max_ ist offline   Mit Zitat antworten
Alt 06-04-2004, 16:59   #13 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Ich bleib dann mal beim Umständlichen
ActionScript:
  1. function anfang() {
  2.     trace(mc1._y);
  3.     anfangy = mc1._y;
  4.     endy = mc1._y+40;
  5. }
  6. anfang();
  7. mc1.onRollOver = function() {
  8.     mc2.onEnterFrame = function() {
  9.         this._y += 4;
  10.         if (this._y>=endy) {
  11.             this._y = endy;
  12.         }
  13.     };
  14.     mc3.onEnterFrame = function() {
  15.         this._y += 4;
  16.         if (this._y>=endy) {
  17.             this._y = endy;
  18.         }
  19.     };
  20.     mc4.onEnterFrame = function() {
  21.         this._y += 4;
  22.         if (this._y>=endy) {
  23.             this._y = endy;
  24.         }
  25.     };
  26. };
  27. mc1.onRollOut = function() {
  28.     mc2.onEnterFrame = function() {
  29.         this._y -= 4;
  30.         if (mc2._y == anfangy) {
  31.             delete this.onEnterFrame;
  32.         }
  33.     };
  34.     mc3.onEnterFrame = function() {
  35.         this._y -= 4;
  36.         if (mc3._y == anfangy) {
  37.             delete this.onEnterFrame;
  38.         }
  39.     };
  40.     mc4.onEnterFrame = function() {
  41.         this._y -= 4;
  42.         if (mc4._y == anfangy) {
  43.             delete this.onEnterFrame;
  44.         }
  45.     };
  46. };
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 06-04-2004, 17:20   #14 (permalink)
Neuer User
 
Benutzerbild von _Max_
 
Registriert seit: May 2003
Beiträge: 2.475
das sieht mehr als gut aus


ich weiss umständlich ja,aber eher verständlicher für mich als noob..


mensch,du hast da ja nur paar zeilen geändert+ eben das ende definiert,lol


NOCHWAS:


wie kann man soetwas SMOOTHER machen?geht des auch?
__________________
!!! www.verblitzt.de !!!

Geändert von Son!c (06-04-2004 um 17:25 Uhr)
_Max_ ist offline   Mit Zitat antworten
Alt 06-04-2004, 17:40   #15 (permalink)
Neuer User
 
Benutzerbild von _Max_
 
Registriert seit: May 2003
Beiträge: 2.475
sry nochmal,habe das jetzt mal alles zusammen gemacht damit es auch nen menu ist

nunja is derbe buggy...aber naja es bewegt sich schonmal

nun jetzt ist das aber kein zustand...guckt euch den AS-code an...der is ja megaa gross...
gibt es da evtl. andre schreibweisen????

ActionScript:
  1. function anfang() {
  2.         trace(mc1._y);
  3.         anfangy = mc1._y;
  4.         endy = mc1._y+50;
  5. }
  6. anfang();
  7. mc1.onrollOver = function() {
  8.         mc2.onEnterFrame = function() {
  9.                 this._y += 4;
  10.                 if (this._y>=endy) {
  11.                         this._y = endy;
  12.                 }
  13.         };
  14.         mc3.onEnterFrame = function() {
  15.                 this._y += 4;
  16.                 if (this._y>=endy) {
  17.                         this._y = endy;
  18.                 }
  19.         };
  20.         mc4.onEnterFrame = function() {
  21.                 this._y += 4;
  22.                 if (this._y>=endy) {
  23.                         this._y = endy;
  24.                 }
  25.         };
  26. };
  27. mc1.onRollOut = function() {
  28.         mc2.onEnterFrame = function() {
  29.                 this._y -= 4;
  30.                 if (mc2._y == anfangy) {
  31.                         delete this.onEnterFrame;
  32.                 }
  33.         };
  34.         mc3.onEnterFrame = function() {
  35.                 this._y -= 4;
  36.                 if (mc3._y == anfangy) {
  37.                         delete this.onEnterFrame;
  38.                 }
  39.         };
  40.         mc4.onEnterFrame = function() {
  41.                 this._y -= 4;
  42.                 if (mc4._y == anfangy) {
  43.                         delete this.onEnterFrame;
  44.                 }
  45.         };
  46.        
  47. };
  48. mc2.onRollOver = function() {
  49.         mc1.onEnterFrame = function() {
  50.                 this._y += 4;
  51.                 if (this._y>=endy) {
  52.                         this._y = endy;
  53.                 }
  54.         };
  55.         mc3.onEnterFrame = function() {
  56.                 this._y += 4;
  57.                 if (this._y>=endy) {
  58.                         this._y = endy;
  59.                 }
  60.         };
  61.         mc4.onEnterFrame = function() {
  62.                 this._y += 4;
  63.                 if (this._y>=endy) {
  64.                         this._y = endy;
  65.                 }
  66.         };
  67. };
  68. mc2.onRollOut = function() {
  69.         mc1.onEnterFrame = function() {
  70.                 this._y -= 4;
  71.                 if (mc1._y == anfangy) {
  72.                         delete this.onEnterFrame;
  73.                 }
  74.         };
  75.         mc3.onEnterFrame = function() {
  76.                 this._y -= 4;
  77.                 if (mc3._y == anfangy) {
  78.                         delete this.onEnterFrame;
  79.                 }
  80.         };
  81.         mc4.onEnterFrame = function() {
  82.                 this._y -= 4;
  83.                 if (mc4._y == anfangy) {
  84.                         delete this.onEnterFrame;
  85.                 }
  86.         };
  87.        
  88. };
  89. mc3.onRollOver = function() {
  90.         mc2.onEnterFrame = function() {
  91.                 this._y += 4;
  92.                 if (this._y>=endy) {
  93.                         this._y = endy;
  94.                 }
  95.         };
  96.         mc1.onEnterFrame = function() {
  97.                 this._y += 4;
  98.                 if (this._y>=endy) {
  99.                         this._y = endy;
  100.                 }
  101.         };
  102.         mc4.onEnterFrame = function() {
  103.                 this._y += 4;
  104.                 if (this._y>=endy) {
  105.                         this._y = endy;
  106.                 }
  107.         };
  108. };
  109. mc3.onRollOut = function() {
  110.         mc2.onEnterFrame = function() {
  111.                 this._y -= 4;
  112.                 if (mc2._y == anfangy) {
  113.                         delete this.onEnterFrame;
  114.                 }
  115.         };
  116.         mc1.onEnterFrame = function() {
  117.                 this._y -= 4;
  118.                 if (mc1._y == anfangy) {
  119.                         delete this.onEnterFrame;
  120.                 }
  121.         };
  122.         mc4.onEnterFrame = function() {
  123.                 this._y -= 4;
  124.                 if (mc4._y == anfangy) {
  125.                         delete this.onEnterFrame;
  126.                 }
  127.         };
  128.        
  129. };
  130. mc4.onrollOver = function() {
  131.         mc2.onEnterFrame = function() {
  132.                 this._y += 4;
  133.                 if (this._y>=endy) {
  134.                         this._y = endy;
  135.                 }
  136.         };
  137.         mc3.onEnterFrame = function() {
  138.                 this._y += 4;
  139.                 if (this._y>=endy) {
  140.                         this._y = endy;
  141.                 }
  142.         };
  143.         mc1.onEnterFrame = function() {
  144.                 this._y += 4;
  145.                 if (this._y>=endy) {
  146.                         this._y = endy;
  147.                 }
  148.         };
  149. };
  150. mc4.onRollOut = function() {
  151.         mc2.onEnterFrame = function() {
  152.                 this._y -= 4;
  153.                 if (mc2._y == anfangy) {
  154.                         delete this.onEnterFrame;
  155.                 }
  156.         };
  157.         mc3.onEnterFrame = function() {
  158.                 this._y -= 4;
  159.                 if (mc3._y == anfangy) {
  160.                         delete this.onEnterFrame;
  161.                 }
  162.         };
  163.         mc1.onEnterFrame = function() {
  164.                 this._y -= 4;
  165.                 if (mc1._y == anfangy) {
  166.                         delete this.onEnterFrame;
  167.                 }
  168.         };
  169.        
  170. };
__________________
!!! www.verblitzt.de !!!
_Max_ 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 05:33 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele