Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 23-05-2004, 10:52   #1 (permalink)
vodoo
Gast
 
Beiträge: n/a
Question Eine stiere Bewegung!!!!

Guten Morgen....

Folgendes: Ich hab ein Viereck mc und möchte, dass er vergrößert wird, nach unten bis zu nem bestimmten punkt.
So das hab ich schon.
Dannn will ich aber, damit es ein bisschen bisser aussieht, dass es noch ein kleines stückchen weiter nachunten sich vergrößert, und das stückchen dann wieder nach oben geht bis zur richtigen pos.
Also im Prinzip so, als würdes runterfallen und dann unten aufprallen.......

danke vodoo
  Mit Zitat antworten
Alt 23-05-2004, 10:59   #2 (permalink)
Coder & Hobbybastler
 
Benutzerbild von haslo
 
Registriert seit: May 2004
Ort: Bern CH
Beiträge: 176
Also grundsätzlich: das machst Du mit Motion Tweens, nicht mit Actionscript, richtig? Mit AS ginge es drum auch...

Mach aus dem Viereck einen MC, dann setze die Keyframes dort, wo Du sie willst (also oben, unten, wieder Bisschen oben, evtl. mit Verformugen zwischendrin oder wie auch immer) und jeweils zwischendrin machst Du einen Motion Tween.
__________________
haslo.ch
haslo ist offline   Mit Zitat antworten
Alt 23-05-2004, 11:02   #3 (permalink)
vodoo
Gast
 
Beiträge: n/a
Nein ! MIT AS! ! !

Weisst ich will mein Seite komplett dynamisch machen , ich weiss auch, dass man das mit Tweens wesentlich leichter machen kann, will aber AS, da dynamische Seite..............

danke
  Mit Zitat antworten
Alt 23-05-2004, 11:09   #4 (permalink)
Coder & Hobbybastler
 
Benutzerbild von haslo
 
Registriert seit: May 2004
Ort: Bern CH
Beiträge: 176
Gute Sache

Poste doch mal den Code, den Du schon hast - sonst passt welche Lösung auch immer sowieso nicht in die bestehende Seite rein...
__________________
haslo.ch
haslo ist offline   Mit Zitat antworten
Alt 23-05-2004, 11:18   #5 (permalink)
________________
 
Benutzerbild von Katze
 
Registriert seit: May 2002
Ort: Braunschweig
Beiträge: 441
Nur als Ansatz

ungetestet und gerade nur ausm kopf geschrieben. Müßtest Du denke ich mal noch weiterführen:

ActionScript:
  1. kasten.onEnterFrame = function() {
  2.     kastenZiel = 197;
  3.     kastenZiel2 = 170;
  4.     var count = 0;
  5.     var count2 = 0;
  6.     speed = 15;
  7.     if (count == 0) {
  8.         kasten._y += speed;
  9.         if (Math.round(kasten._y)>=kastenZiel) {
  10.             count = 1;
  11.             kasten._y = kastenZiel;
  12.         }
  13.     }
  14.     if (count2 == 0 && count == 1) {
  15.         kasten._y -= speed;
  16.         if (Math.round(kasten._y)>=kastenZiel2) {
  17.             count2 = 1;
  18.             kasten._y = kastenZiel2;
  19.         }
  20.     }
  21. };
  22. stop();

mfg Katze
__________________
Etwas nicht zu können, ist kein Grund es nicht zu tun!

STUDIO B12 Blog
Katze ist offline   Mit Zitat antworten
Alt 23-05-2004, 11:41   #6 (permalink)
vodoo
Gast
 
Beiträge: n/a
Also das kapier icht nicht so ganz....

Hier ist mal meins :

ActionScript:
  1. MovieClip.prototype.ani = function (derbutton) {
  2.     this.onEnterFrame = function() {
  3.         if(_root.derbutton.rechteck._yscale >= 10) {
  4.             _root.derbutton.rechteck._yscale += 10)
  5.         } else if (_root.derbutton.rechteck._yscale >= 200) {
  6.             delete this.onEnterFrame
  7.         }
  8.     }
  9.  
  10. _root.bthome.onRollOver = function () {
  11.     this.ani(bthome)
  12. }

aber irgendwie bekomm ich da syntaxfehler ???

danke

Geändert von vodoo (23-05-2004 um 11:43 Uhr)
  Mit Zitat antworten
Alt 23-05-2004, 12:10   #7 (permalink)
vodoo
Gast
 
Beiträge: n/a
Will irgendwie nicht, hier mal die .fla
Angehängte Dateien
Dateityp: zip unbenannt-1.zip (5,4 KB, 3x aufgerufen)
  Mit Zitat antworten
Alt 23-05-2004, 12:19   #8 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
mach mal so, !
ActionScript:
  1. MovieClip.prototype.ani = function(derbutton) {
  2.     this.onEnterFrame = function() {
  3.         trace(_root.rechteck._yscale);
  4.         if (_root.rechteck._yscale>=10) {
  5.             _root.rechteck._yscale += 10;
  6.         }
  7.         if (_root.rechteck._yscale>=200) {
  8.             delete this.onEnterFrame;
  9.         }
  10.     };
  11. };
  12. _root.bthome.onRollOver = function() {
  13.     this.ani();
  14. };
__________________
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 23-05-2004, 12:36   #9 (permalink)
vodoo
Gast
 
Beiträge: n/a
Rusty, es geht aber um was anders, trotzdem danke
  Mit Zitat antworten
Alt 23-05-2004, 13:05   #10 (permalink)
vodoo
Gast
 
Beiträge: n/a
upturn
  Mit Zitat antworten
Alt 23-05-2004, 14:20   #11 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
@ vodoo
Des bezog sich auf Dein gepostetes script
__________________
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 23-05-2004, 14:26   #12 (permalink)
vodoo
Gast
 
Beiträge: n/a
Ja und zu meim anderen Prob weiss keiner was?
  Mit Zitat antworten
Alt 23-05-2004, 17:38   #13 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Anpassen mußt des Ding halt selbst!!
ActionScript:
  1. function kill_OEF(mc) {
  2.     delete mc.onEnterFrame;
  3. }
  4. MovieClip.prototype.mover = function(ts, y1, y2) {
  5.     this.onEnterFrame = function() {
  6.         this._y += ts;
  7.         if (this._y == y1) {
  8.             this.onEnterFrame = function() {
  9.                 this._y -= ts;
  10.                 if (this._y == y2) {
  11.                     kill_OEF(this);
  12.                 }
  13.             };
  14.         }
  15.     };
  16. };
  17. this.btn.onPress = function() {
  18.     this._parent.mc.mover(5, 200, 180);
  19. };
__________________
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 23-05-2004, 19:34   #14 (permalink)
vodoo
Gast
 
Beiträge: n/a
Habs so gemacht
ActionScript:
  1. function kill_OEF(mc) {
  2.         delete mc.onEnterFrame;
  3. }
  4. MovieClip.prototype.mover = function(ts, y1, y2) {
  5.         this.onEnterFrame = function() {
  6.                 this._y += ts;
  7.                 if (this._y == y1) {
  8.                         this.onEnterFrame = function() {
  9.                                 this._y -= ts;
  10.                                 if (this._y == y2) {
  11.                                         kill_OEF(this);
  12.                                 }
  13.                         };
  14.                 }
  15.         };
  16. };
  17. _root.bthome.onPress = function() {
  18.         this._parent.mc.mover(5, 200, 180);
  19. };
weil mein buttoon heisst bthome, aber es tut sich nix, versteh das ned, denn ich hab das script verstanden
  Mit Zitat antworten
Alt 23-05-2004, 19:35   #15 (permalink)
vodoo
Gast
 
Beiträge: n/a
so funtzt es
ActionScript:
  1. MovieClip.prototype.mover = function(ts, y1, y2) {
  2.         this.onEnterFrame = function() {
  3.                 this._y += ts;
  4.                 if (this._y == y1) {
  5.                         this.onEnterFrame = function() {
  6.                                 this._y -= ts;
  7.                                 if (this._y == y2) {
  8.                                         delete this.onEnterFrame;
  9.                                         delete this.onEnterFrame;
  10.                                 }
  11.                         };
  12.                 }
  13.         };
  14. };
  15. _root.bthome.onPress = function() {
  16.         this.mover(5, 200, 180);
  17. };

danke Rusty
  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 07:04 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele