Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 22-04-2005, 22:35   #1 (permalink)
ready4takeoff
 
Registriert seit: Sep 2003
Ort: stuttgart.germany
Beiträge: 22
Buttons stören sich beim zoom-Rollover

Ich habe 5 icons nebeneinander, die beim Rollover größer werden, beim Rollout wieder kleiner. Dafür verwende ich folgende Funktionen:

ActionScript:
  1. function icon_zoomin(movieclip) {
  2.    MZoom = 130;
  3.    movieclip.onEnterFrame = function() {
  4.    movieclip._xscale += 10;
  5.    movieclip._yscale += 10;
  6.    if (movieclip._xscale>=MZoom) {
  7.    delete movieclip.onEnterFrame;
  8.   }
  9.  };
  10. };
  11.  
  12. function icon_zoomout(movieclip) {
  13. MZoom2 = 100;
  14.    movieclip.onEnterFrame = function() {
  15.    movieclip._xscale -= 10;
  16.    movieclip._yscale -= 10;
  17.    if (movieclip._xscale<=MZoom2) {
  18.    delete movieclip.onEnterFrame;
  19.   }
  20.  };
  21. };

Soweit so gut. Es funktioniert. Wenn ich allerdings die Maus schnell über alle Icons bewege, so verkleinern / vergrößern sie sich nicht mehr wie gewollt, Anscheinend werden die Variablen beim mehrmaligen schnellen Aufruf der Funktionen überschrieben und deshalb wird der entsprechende zoom dann auf das falsche Icon angewendet. Kann das sein? Was würde Abhilfe schaffen?
__________________
daydreams on wax
Waxmaster ist offline   Mit Zitat antworten
Alt 22-04-2005, 22:53   #2 (permalink)
Waffe==Verstand
 
Benutzerbild von p-flash
 
Registriert seit: Jul 2004
Ort: Düsseldorf
Beiträge: 724
Kannst du die Fla posten? Schreib mal statt movieclip zB mc, da movieclip eine Klasse ist. Vllt liegt es daran.

p-flash
p-flash ist offline   Mit Zitat antworten
Alt 22-04-2005, 22:54   #3 (permalink)
Achim Math.PI
 
Benutzerbild von bloba
 
Registriert seit: Jul 2001
Ort: cool Colonia
Beiträge: 11.642
hab dir den code mal ein weinig "optimert" und getstet - funzt einwandfrei
viel spass und bei fragen fragen
ActionScript:
  1. MovieClip.prototype.icon_zoomin = function(wert, speed) {
  2.     this.onEnterFrame = function() {
  3.         if (this._xscale<=wert) {
  4.             this._xscale = this._yscale += 10;
  5.         } else {
  6.             delete this.onEnterFrame;
  7.         }
  8.     };
  9. };
  10. MovieClip.prototype.icon_zoomOut = function(wert, speed) {
  11.     this.onEnterFrame = function() {
  12.         if (this._xscale>wert) {
  13.             this._xscale = this._yscale -= 10;
  14.         } else {
  15.             delete this.onEnterFrame;
  16.         }
  17.     };
  18. };
  19. for (i=1; i<=5; i++) {
  20.     this["meinmc"+i].onRollOver = function() {
  21.         this.icon_zoomin(130, 2);
  22.     };
  23.     this["meinmc"+i].onRollOut = function() {
  24.         this.icon_zoomOut(100, 2);
  25.     };
  26. }
__________________
gruß bloba

2 x onkel² b_d
bloba ist offline   Mit Zitat antworten
Alt 24-04-2005, 16:09   #4 (permalink)
ready4takeoff
 
Registriert seit: Sep 2003
Ort: stuttgart.germany
Beiträge: 22
funktioniert!

SUPER! Vielen vielen Dank. Jetzt klappt's einwandfrei!
__________________
daydreams on wax
Waxmaster ist offline   Mit Zitat antworten
Alt 24-04-2005, 16:47   #5 (permalink)
ready4takeoff
 
Registriert seit: Sep 2003
Ort: stuttgart.germany
Beiträge: 22
doch noch eine Frage

jetzt habe ich doch noch eine Frage: Der Parameter "speed" wird im Moment noch nicht verarbeitet. Wie kann ich denn die Geschwindigkeit tatsächlich abhängig von "speed" machen?
__________________
daydreams on wax
Waxmaster ist offline   Mit Zitat antworten
Alt 24-04-2005, 17:04   #6 (permalink)
Waffe==Verstand
 
Benutzerbild von p-flash
 
Registriert seit: Jul 2004
Ort: Düsseldorf
Beiträge: 724
anstatt += 10 bzw -= 10 einfach += speed bzw -= speed.

p-flash
p-flash 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 22:44 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele