| **Flash Floating Seed Effect - Need help with this effect... looks right, but no go...**
on Jun 5, 2006 at 8:37:18 pm |

Hello,

I'm trying to create a nice effect for a website I am creating for a client. I'm looking for some actionscript that wil duplicate a movie clip of a Dandelion Seed and float it accross the stage as if blown by the wind. Right now I am trying to get the actionscript working for the wind effect and have come up with this so far:

function deg2rad (degrees){

return deg2rad * Math.PI/180;

}

seed.startx = 10;

seed.endx = 350;

seed.starty = 800;

seed._x = startx;

seed._y = starty;

seed.xinc = 16;

seed.yadj = 8;

seed.xadj = 8;

seed.onEnterFrame = function(){

if (seed._x < seed.endx){

seed._x += seed.xinc + (xadj * Math.sin(deg2rad(_x)))

seed._y += seed.yadj * Math.sin (deg2rad(seed._x));

}

}

Now... all the code seems right but I'm not getting any movement from left to right on the screen. I'll worry about the duplication later after I get the motion working...

If anyone can help... I've got a deadline to make... lol

Thanks,

| **Re: Flash Floating Seed Effect - Need help with this effect... looks right, but no go...** on Jun 6, 2006 at 1:57:12 pm |

seed._x += seed.xinc + (xadj * Math.sin(deg2rad(_x)))

This line is missing some pathing. Try:

seed._x += seed.xinc + (seed.xadj * Math.sin(deg2rad(seed._x)))

Matt

--------------------

http://www.mcquillendesign.comhttp://www.mattfoxgames.com