Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 06-08-2004, 17:32   #1 (permalink)
Neuer User
 
Registriert seit: Jan 2003
Beiträge: 172
20 = 19.921875???

Hi there

Ich frage mich langsam ob ich spinne oder ob Flash da ein Problemchen hat...
Heute wollte ich mal so husch husch ein scriptchen für ein "Credits" System schreiben (Wie am ende eines Films). Eigentlich keine grosse Sache...

Der Aufbau: Ich habe einen Array mit den Namen. Ich mache für jeden Namen einen MC. Die MC's werden mittels "onEnterFrame" nach oben wandern. Wenn ein MC bei y=100 oder y<100 ankommt, soll sein _alpha 20 sein...

Komischerweise ist _alpha nicht 20, sondern 19.921875!?!??
Wat soll dat den bitteschön?

Kann mir da jemand einen Tipp geben?




ActionScript:
  1. names = ["George", "Kevin", "Sandra", "Will", "Bruce", "Nicole", "Kathrin", "Michael", "Robert", "Jackie"];
  2.  
  3. template = new TextFormat();
  4. template.font = "Verdana";
  5. template.size = 10;
  6. template.bold = true;
  7. template.align = "center";
  8. template.embedFonts = true;
  9.  
  10. // Credits MC's
  11. for(var i=1; i<=names.length; i++) {
  12.     createEmptyMovieClip("credit"+i, i);
  13.     this["credit"+i]._y = (Stage.height+10) + (i*25);
  14.     this["credit"+i].onEnterFrame = function() {
  15.         this.moveUp();
  16.     }
  17.    
  18.     // Text
  19.     this["credit"+i].createTextField("tf", 20+i, 0, 0, 250, 18);
  20.     this["credit"+i]["tf"].text = names[i-1];
  21.     this["credit"+i]["tf"].setTextFormat(template);
  22. }
  23.  
  24. MovieClip.prototype.moveUp = function() {
  25.     this._y -= 1;
  26.     if(this._y < 100) {
  27.         this.autoFade();
  28.     }
  29. }
  30.  
  31. MovieClip.prototype.autoFade = function() {
  32.     if(this._alpha < 0) {
  33.         this.removeMovieClip();
  34.     } else {
  35.         this._alpha = 20;
  36.         trace(this._alpha);
  37.     }
  38. }
R3PL4Y ist offline   Mit Zitat antworten
Alt 06-08-2004, 17:33   #2 (permalink)
meistens harmlos
 
Benutzerbild von rena
 
Registriert seit: Jun 2001
Ort: Stuttgart
Beiträge: 17.643
Alois hat das hier mal schön erklärt
_ alpha stimmt nicht !!!

Gruß
Rena
__________________
www.rena-hermann.de

The angels have the phone box
rena ist offline   Mit Zitat antworten
Alt 06-08-2004, 17:39   #3 (permalink)
Neuer User
 
Registriert seit: Jan 2003
Beiträge: 172
Danke Rena!

Das wusste ich nicht. Jetzt gehts ;-)
R3PL4Y 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 20:44 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele