1&1 DSL
Flashhilfe.de - Flash Community

set rgb -- smooth [Flash 9]

Forum > ActionScript 2.0 > set rgb -- smooth

 


AntwortenRegistrieren Seite1  

 14.09.2010, 10:30 
Beiträge: 73
Wohnort: Frankfurt am Main
Registriert: Nov 2008

set rgb -- smooth
Hallo zusammen,

gibt es eine Möglichkeit den folgenden Farbwechsel als "weichen" Übergang auszuführen?

ActionScript:
1
2
3
4
5
6
function co_set6()
{
     var my_color:Color = new Color(bg_mc);
     my_color.setRGB(0x330033);
     var myValue:String = my_color.getRGB().toString(16);
}


Grüße Mike
Wer später bremst, ist länger schnell    ....
 14.09.2010, 14:48Re1
Benutzerbild von jens108
Beiträge: 85
Registriert: Aug 2010

Ich hab mal eine solche Funktion verwendet:

ActionScript:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Verwendung:
_root.movieclip.beginColorTween(alt, neu, 2*1000);

// Funktion
// Funktionen zum Blender der Farben von Dingen.
doTween = function () {
     // t will go from 0 to 1 over the time specified by this.dur (duration)
   var t = (getTimer()-this.startTime)/this.dur;
     if (t>1) {
        t = 1;
        delete this.onEnterFrame;
     }
     col = new Object();
     col.ra = t*this.ra2+(1-t)*this.ra1;
     col.rb = t*this.rb2+(1-t)*this.rb1;
     col.ga = t*this.ga2+(1-t)*this.ga1;
     col.gb = t*this.gb2+(1-t)*this.gb1;
     col.ba = t*this.ba2+(1-t)*this.ba1;
     col.bb = t*this.bb2+(1-t)*this.bb1;
     //col.aa = t*this.aa2 + (1-t)*this.aa1;
   //col.ab = t*this.ab2 + (1-t)*this.ab1;
   this.clr.setTransform(col);
};
MovieClip.prototype.beginColorTween = function(alt, neu, durat) {
     this.ra1 = alt.ra;
     this.ra2 = neu.ra;
     this.rb1 = alt.rb;
     this.rb2 = neu.rb;
     this.ga1 = alt.ga;
     this.ga2 = neu.ga;
     this.gb1 = alt.gb;
     this.gb2 = neu.gb;
     this.ba1 = alt.ba;
     this.ba2 = neu.ba;
     this.bb1 = alt.bb1;
     this.bb2 = neu.bb;
     this.aa1 = alt.aa;
     this.aa2 = neu.aa;
     this.ab1 = alt.ab;
     this.ab2 = neu.ab;
     this.dur = durat;
     this.startTime = getTimer();
     this.clr = new Color(this);
     this.onEnterFrame = doTween;
};


Der Code ist allerdings nicht von mir.
Du möchtest Flash und AS3 lernen? Schau mal bei meinen Flashtutorials unter www.tutorialflash.de vorbei! Neuste Tutorialreihe: Sicherheit deiner Flashanwendungen. Schutz vor Hacks und Cheats, inkl. Anleitungen wie die Hacks funktionieren.
 14.09.2010, 20:15Re2
Benutzerbild von springerFlashhilfe.de Moderator
Beiträge: 4906
Wohnort: zuhaus
Registriert: Apr 2004

hi,
du kannst dafür auch Tweener verwenden.... hier ein beispiel.
lieber chips essen und danach voller zweifel sein, als voller zweifel chips essen...
 
nicht sichtbar bei eingeloggten Mitgliedern
 
Themen
Ähnliche Beiträge zum Thema
 

AntwortenRegistrieren Seite1  

Schnellantwort

Du musst registriert sein, um diese Funktion nutzen zu können.
Partner Webseiten: DesignerInAction.de   Designnation.de   Mediengestalter.info   php-resource.de   phpforum.de   phpwelt.de   Pixelio.de   PSD-Tutorials.de   Tutorials.de

Haftungsausschluss   Datenschutzerklärung   Hier Werben   Impressum
© 1999-2012 Sebastian Wichmann - Flashhilfe.de