Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 29-06-2005, 13:39   #1 (permalink)
// pagebuilder
 
Benutzerbild von cmike
 
Registriert seit: Apr 2002
Beiträge: 124
yugop scrollmenü ruckelt :( -> performanceoptimierung

hi all

ich hab ein kleines performance problem mit nem yugop style scrollmenü, das ich selbst gebastelt hab. dieses hat eigentlich ne einfache funktion:

1. wenn ich mit dem mauszeiger NICHT über der leiste bin, schnappt es beim aktiven menüpunkt ein.

2. links und rechts vom menü hab ich zwei pfeilbuttons. wenn ich mit dem mauszeiger über diese fahre, soll das menü in die jeweilige richtung scrollen.

auf dem bildstreifen hab ich folgenden AS code:

ActionScript:
  1. onClipEvent(load) {
  2.     arrSpeed  = new Array(0, 1, 2, 4, 8, 9, 10);
  3.     intSpeed  = 0;
  4.     intActive = _root.objContent.getPageNr();
  5.     this._x   = -50;
  6. }
  7.  
  8. onClipEvent(enterFrame) {
  9.     if (_parent._xmouse > 0 && _parent._xmouse < 320 &&
  10.         _parent._ymouse > 0 && _parent._ymouse < 61) {
  11.         if (bolMove == true && intSpeed < 7) {
  12.             intSpeed++;
  13.         } else if (intSpeed > 0) {
  14.             intSpeed--;
  15.         }
  16.         if (bolLeft == true) {
  17.             if (this._x + arrSpeed[intSpeed] > 0) {
  18.                 this._x = Math.round(this._x / 2);
  19.             } else {
  20.                 this._x += arrSpeed[intSpeed];
  21.             }
  22.         } else {
  23.             if (this._x - arrSpeed[intSpeed] < 320 - this._width) {
  24.                 this._x = Math.round((this._x + 320 - this._width) / 2);
  25.             } else {
  26.                 this._x -= arrSpeed[intSpeed];
  27.             }
  28.         }
  29.     } else {
  30.         intSpeed = 0;
  31.         this._x  = Math.round((this._x*3 - 60 - intActive*40)/4);
  32.     }
  33. }


hat jemand eine idee, wie ich diesen code im bezug auf eine performanceverbesserung noch optimieren kann?


cheers!

mike
__________________
// ************************************
// progress means simplifying not complicating
// bkanal

Geändert von cmike (29-06-2005 um 13:40 Uhr)
cmike 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 14:14 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele