Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 22-02-2006, 22:29   #1 (permalink)
Neuer User
 
Registriert seit: Feb 2006
Beiträge: 20
Flash MX Blasen Animation !

Hi Leute dies ist ein Script für fliegende Blasen, klapt auch super geil, nur ich bekomme es einfach nicht hin, das die Blasen nicht von links nach rechts fliegen sondern von rechts nach links !

kann mir da wer schnell helfen, ich hab keine Ahnung von dem Script ...

vielen Dank !!!


Code:
MovieClip.prototype.schnee = function(pObj, pAnzahl, pBreite, pHoehe) {
	for (var i = 0; i<=pAnzahl; i++) {
		this.attachMovie(pObj, "flocke"+i, i);
		this["flocke"+i]._x = Math.round(Math.random()*pBreite);
		this["flocke"+i]._y = Math.round(Math.random()*pHoehe);
		this["flocke"+i].faktor = ((this["flocke"+i]._alpha=Math.random()*100));
		this["flocke"+i]._height = (this["flocke"+i]._width=500/this["flocke"+i].faktor);
		this["flocke"+i].zufall = 1+(Math.random()*5);
		this["flocke"+i].onEnterFrame = function() {
			this.kante = pBreite+this._width;
			this.spos = -this._width;
			this.xpos = this._x;
			this.tempo += this.zufall;
			this.rad = (this.tempo/180)*Math.PI;
			if (this.rad>Math.PI*2) {
				this.rad = this.rad-Math.PI*2;
			}
			if (this.xpos<this.kante) {
				this._x = this._x+this.zufall;
				this._y = this._y+Math.cos(this.rad);
			} else {
				this._x = this.spos;
			}
		};
	}
};
schnee("fClip", 100, Stage.width, Stage.height);
Vorschau
Download
PhaDlaDy ist offline   Mit Zitat antworten
Alt 22-02-2006, 22:36   #2 (permalink)
°.oO°O.o°.oO.o°O
 
Benutzerbild von bamboocha
 
Registriert seit: Jun 2005
Ort: CH
Beiträge: 1.490
Diese Zeilen musst du anpassen (und evtl. die dazugehörenden Werte (pBreite, etc.)):
PHP-Code:
if (this.xpos<this.kante) {
                
this._x this._x+this.zufall;
                
this._y this._y+Math.cos(this.rad);
    } 
__________________
There is no way to happiness, happiness is the way! - Buddha
bamboocha ist offline   Mit Zitat antworten
Alt 23-02-2006, 00:35   #3 (permalink)
Neuer User
 
Registriert seit: Feb 2006
Beiträge: 20
Ja danke, aber soweit bin ich auch schon gekommen, ich weis nur nicht genau was ich ändern muss und wie. Wenn ich x mit y vertausche kommen die BLasen aufeinmal von Oben ^^ ...

:/
PhaDlaDy ist offline   Mit Zitat antworten
Alt 23-02-2006, 01:26   #4 (permalink)
brand new user
 
Benutzerbild von RustyCake
 
Registriert seit: May 2002
Ort: Laimbach 6 1/2
Beiträge: 16.884
Servus!!
PHP-Code:
MovieClip.prototype.schnee = function(pObjpAnzahlpBreitepHoehe) {
    for (var 
0i<=pAnzahli++) {
        
this.attachMovie(pObj"flocke"+ii);
        
this["flocke"+i]._x Math.round(Math.random()*pBreite);
        
this["flocke"+i]._y Math.round(Math.random()*pHoehe);
        
this["flocke"+i].faktor = ((this["flocke"+i]._alpha=Math.random()*100));
        
this["flocke"+i]._height = (this["flocke"+i]._width=500/this["flocke"+i].faktor);
        
this["flocke"+i].zufall 1+(Math.random()*5);
        
this["flocke"+i].onEnterFrame = function() {
            
this.kante = -this._width;//hier
            
this.spos = -this._width+pBreite;//hier
            
this.xpos this._x;
            
this.tempo += this.zufall;
            
this.rad = (this.tempo/180)*Math.PI;
            if (
this.rad>Math.PI*2) {
                
this.rad this.rad-Math.PI*2;
            }
            if (
this.xpos>this.kante) {
                
this._x this._x-this.zufall;//hier
                
this._y this._y-Math.cos(this.rad);//und hier
            
} else {
                
this._x this.spos;
            }
        };
    }
};
schnee("fClip"100Stage.widthStage.height); 
__________________
Bitte keine Fragen, zu Flash per PM. Dazu ist das Forum da. Danke MFG_RustyCake!
"Wer tanzen will, muß erst gehen lernen"
RustyCake ist offline   Mit Zitat antworten
Alt 23-02-2006, 06:53   #5 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
[ot-sorry]
wusste gar nicht, dass es "schneeblasen" gibt....
open mindend-yeah!
[/ot-sorry]
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 23-02-2006, 10:57   #6 (permalink)
Neuer User
 
Registriert seit: Feb 2006
Beiträge: 20
Vielen Dank !
PhaDlaDy 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 10:23 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele