Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 24-10-2007, 11:47   #1 (permalink)
Neuer User
 
Registriert seit: Dec 2006
Beiträge: 35
Schneeflocken

Ich habe ein Problem. Der folgende Auszug aus einem Skript soll bewirken, dass Schneeflocken nicht gerade nach unten fliegen, sondern per Zufall durcheinander herunterkommen.

Das ganze funktioniert wunderbar wenn ich es in Flash6 exportiere. Jedoch gehts mit Flash7 oder Flash8 nicht. Kann mir jemand sagen warum?

this["flocke"+i].wind = -Math.PI+(Math.random()*Math.PI);
this["flocke"+i].onEnterFrame = function() {
this.rad += ((this.wind/180)*Math.PI);
this._x -= Math.cos(this.rad);
this._y += this.zufall;
if (this._y>=pHoehe) {
this._y = -5;
}
if ((this._x>=pBreite) || (this._x<=0)) {
this._x = -10+(Math.random()*pBreite);
}
};
distace ist offline   Mit Zitat antworten
Alt 24-10-2007, 11:57   #2 (permalink)
Nix Wisser
 
Benutzerbild von nullidee
 
Registriert seit: May 2003
Ort: Würzburg, Kleinstadt
Beiträge: 3.510
falls du dich auf dieses Script beziehst
dein rad war undefined
PHP-Code:
function schnee(pAnzahlpBreitepHoehe) {
    for (var 
0i<=pAnzahli++) {
        var 
mc this.attachMovie("fClip""flocke"+ii);
        
mc.skal 50+(Math.random()*100);
        
mc.alpha 20+(Math.random()*50);
        
mc._xscale mc.skal;
        
mc._yscale mc.skal;
        
mc.xpos mc._x;
        
mc._x = -10+(Math.random()*pBreite);
        
mc.zufall 1+(Math.random()*2);
        
mc._y = -10+(Math.random()*pHoehe);
        
mc.wind = -Math.PI+(Math.random()*Math.PI);
    
mc.rad 0;
        
mc.onEnterFrame = function() {
            
this.rad += ((this.wind/180)*Math.PI);
            
this._x -= Math.cos(this.rad);
            
this._y += this.zufall;
            if (
this._y>=pHoehe) {
                
this._y = -5;
            }
            if ((
this._x>=pBreite) || (this._x<=0)) {
                
this._x = -10+(Math.random()*pBreite);
            }
        };
    }
}
schnee(20,Stage.width+30,Stage.height+100); 
__________________
nullidee

Abakus GT 10² Kugeln - 80"Leinwand - CARAN D´ACHE SUPRACOLOR®
nullidee ist offline   Mit Zitat antworten
Alt 24-10-2007, 12:07   #3 (permalink)
Neuer User
 
Registriert seit: Dec 2006
Beiträge: 35
ja jetzt gehts, danke =)

Geändert von distace (24-10-2007 um 12:10 Uhr)
distace 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 04:21 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele