
Welcome Guest
|
#1
|
|||
|
|||
|
Hi there,
I'm pretty much a flash newbie and now have a problem I'm seeking help with. I reworked some code from this falling snow tutorial to make the particles rise up like bubbles. So this is what my action script now looks like: Code:
amount = 100;
mWidth = Stage.width;
mHeight = Stage.height;
for (var i = 0; i<amount; i++) {
thisFlake = this.attachMovie("flake", "flake"+i, i);
with (thisFlake) {
_x = Math.random()*mWidth;
_y = Math.random()*mHeight;
_xscale = _yscale=_alpha=40+Math.random()*60;
}
thisFlake.yspeed = Math.random()*2+.2;
thisFlake.increment = -0.025+Math.random()*0.05;
thisFlake.radian = 0; //declare for actionscript 2.0
thisFlake.onEnterFrame = function() {
this.radians += this.increment;
//trace(this.radians);
this._x += Math.sin(this.radians);
this._y -= this.yspeed;
if (this._y<= 0) {
this._y = 175;
this._x = 10+Math.random()*mWidth;
}
if (this._x>=mWidth || this._x<=0) {
this._y = 175;
this._x = 10+Math.random()*mWidth;
}
};
}So, is anybody here experienced enough to figure out and explain to me what to do to make this script work in an animation with more than 1 key frame in its timeline? Thank you very much in adavance, your help is appreciated! =) Last edited by eloa : 09-02-2005 at 08:34 PM |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Long time animator, first time action script | easthali | Newbies |
0 | 08-24-2006 05:49 PM |
| Key logging and movieclip goto problem | Dr. Wombat | Flash MX |
1 | 12-30-2005 11:23 AM |
| I need an action script | Ballswick | Game Programming |
1 | 12-07-2005 05:42 AM |
| Please Help FLASH GURUS - Game action script | New York | Flash MX ActionScript |
6 | 08-29-2003 01:28 PM |
| Action Script vs Shape tween | debonaireFlash | General Flash | 1 | 06-28-2002 01:25 AM |




