Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 22-10-2003, 14:27   #1 (permalink)
Neuer User
 
Registriert seit: Apr 2002
Ort: Lübeck
Beiträge: 39
AS performace-problem

Hallo, Hallo,

hm, die Linien sind da, aber die Geschwindigkeit laesst zu wünschen übrig. Kann mir jemand einen tip geben, ob man das irgendwie Beschleunigen kann?

ActionScript:
  1. // die speedlinien
  2.  
  3. Linie = function () {
  4.     this.level = ++ this.constructor.count + 100;
  5.     this.name = "myLine"+this.level;
  6.     _root.createEmptyMovieClip(this.name,this.level);
  7.     this.init ();
  8.     setInterval(this,"move",this.speed);
  9.     }
  10.    
  11. // definitionen der internen Methoden der Klasse Linie
  12. Linie.prototype.init = function() {
  13.     this.faktor = Math.floor(Math.random() *10)+1;
  14.     this.xa = 600 + this.faktor *30 ; //  Anfangspunkt
  15.     this.xb = this.xa + (this.faktor * this.laenge); //  Endpunkt
  16.     this.ya = Math.floor(Math.random() *400 );
  17.     this.speed = this.faktor;
  18.     }
  19. Linie.prototype.move = function ()
  20.     {
  21.     this.xa --;
  22.     this.xb --;
  23.     if(this.xb < 0){
  24.         this.init();
  25.         }
  26.     this.maleLinie(this.name,this.level,this.ya,this.xa,this.xb);
  27.     }
  28. Linie.prototype.maleLinie = function (name,level,ya,xa,xb)
  29.     {
  30.     _root[name].clear();
  31.     with (_root[name]){
  32.         lineStyle(1,this.farbe,level);
  33.         moveTo(xa,ya);
  34.         lineTo(xb,ya);
  35.         }
  36.     }
  37.  
  38.    
  39. Linie.count = 0;
  40. Linie.prototype.level = 100;
  41. Linie.prototype.laenge = 10;
  42. Linie.prototype.farbe = 0xF1F2f1;
  43.  
  44. for (k = 1 ; k < 10 ; k ++){
  45.     _root[k] = new Linie();
  46.     };
  47. this.stop();

besten dank im voraus

t
__________________
Torsten

--
one world - one tribe
leiferikson 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 00:30 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele