| |||||||
Du magst keine Werbung? Wir auch nicht!
Einfach registrieren und die Werbung ist weg. Diese Nachricht sehen nur nicht registrierte Nutzer.
![]() |
| | LinkBack | Themen-Optionen | Ansicht |
| | #1 (permalink) |
| völlig unkreativ Registriert seit: Feb 2004
Beiträge: 27
|
Movieclip.prototype.scale = function(psx, psy, speed) { var mc = this; var xscale; var yscale; mc.onEnterFrame = function() { if (Math.round((mc._xscale - psx)) == 0 and Math.round((mc._yscale - psy)) == 0) { stop(); } else { xscale = Math.round((psx - mc._xscale)) * speed; mc._xscale += xscale; yscale = Math.round((psy - mc._yscale)) * speed; mc._yscale += yscale; trace((mc._xscale - psx)); updateAfterEvent(); } }; }; Movieclip.prototype.slide = function(tx, ty, spd) { var mc = this; var x; var y; mc.onEnterFrame = function() { x = (tx - mc._x) * spd; mc._x += x; y = (ty - mc._y) * spd; mc._y += y; if (Math.round((mc._x - tx)) == 0 and Math.round((mc._y - ty)) == 0) { } updateAfterEvent(); }; }; Das sind meinen beiden Prototypen im 1. Frame. Der Funktionsaufruf sieht so aus: on (release) { _root.cont.scale(30,30,0.3); _root.cont.slide(140,330,0.5);} Problem: Nur das was oben steht (hier "scale") wird ausgeführt. Der slide wird nicht abgearbeitet. Wieso nicht?? |
| | |
| | #2 (permalink) |
| mod_rewrite Registriert seit: Feb 2003 Ort: München
Beiträge: 15.621
|
Die beiden oEF kommen sich in die Quere, da geht halt nur einer pro MC...
__________________ RTFM Wie man Fragen richtig stellt. Achim Bindannmalweg Money makes the world go round, fear makes it turn much faster. (New Model Army) |
| | |
| | #4 (permalink) |
| mod_rewrite Registriert seit: Feb 2003 Ort: München
Beiträge: 15.621
|
Ja, entweder beides in einen prototype packen oder mit setInterval arbeiten. Übrigens steht da z.T. bissl Unfug drin: stop(); is dazu gedacht, um in der Timeline anzuhalten, das bringt dir in ner Funktion nix (Funktion abbrechen: return(); ) updateAfterEvent() bringt hier auch nix, weil du ja eh einen onEnterFrame hast, d.h. es wird bei jedem Frame-Durchlauf aktualisiert. (updateAfterEvent() brauchst z.B. bei onMouseMove)
__________________ RTFM Wie man Fragen richtig stellt. Achim Bindannmalweg Money makes the world go round, fear makes it turn much faster. (New Model Army) |
| | |
| | #6 (permalink) |
| brand new user Registriert seit: May 2002 Ort: Laimbach 6 1/2
Beiträge: 16.884
|
Aloa! Du kannst Dir im übrigen die Referenz "var mc =this" sparen! Kannst gleich this.onEnterFrame schreiben!! Hi sonar
__________________ Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake! "Wer tanzen will, muß erst gehen lernen" |
| | |
![]() |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
| |