LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-02-2005, 08:32 PM
eloa eloa is offline
Registered User
 
Join Date: Sep 2005
Posts: 1
Rep Power: 0
eloa is on a distinguished road
Exclamation Action script and key frames problem

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;
}
};
}
The problem now occurs when I'm trying to add another layer with more than 1 key frame to the animation. The timeline hitting a key frame resets the bubble animation and makes them blink in various spots instead of constantly moving upwarts.

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
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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




All times are GMT. The time now is 01:51 AM.