Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

phadam

macrumors regular
Original poster
Jan 21, 2009
123
0
Anybody know of any particle effect tutorials i can follow in as3??? I would like to use one as a background on my site but I can only seem to find as1 and as2 tutorials. Still a learning process for me :)

here is a link to what i am looking for
http://www.actionscript.org/resources/articles/125/1/Simple-Particle-Effect/Page1.html

ive done some searching and found other useful tutorials but still no luck on the particle effect. thanks
 
I followed the tutorial and changed the code to AS3.
Works pretty well.

frame1:
Code:
var xMin:int = 0;
var xMax:int = 550;
var yMin:int = 0;
var yMax:int = 400;
var minSize:int = 10;
var maxSize:int = 50;
var easeFactor:int = 10;

var randomX:int = Math.random () * ( xMax - xMin ) + xMin;
var randomY:int = Math.random () * ( yMax - yMin ) + yMin;
var randomSize:int = Math.random () * ( maxSize - minSize ) + minSize;
frame3:
Code:
var distance:int = Math.sqrt(Math.pow(this.x-randomX, 2)+Math.pow(this.y-randomY, 2));

if (Math.abs(this.width-maxSize)>1)
{
	this.width += (randomSize-this.width)/2;
	this.height += (randomSize-this.height)/2;
}

if (distance>1)
{
	this.x += (randomX-this.x)/easeFactor;
	this.y += (randomY-this.y)/easeFactor;
	gotoAndPlay(2);
} else
{
	gotoAndPlay(1);
}
 
awesome. works great. i may head down to the book store this weekend. I'll definitely check out that book by Keith Peters.

Thanks guys. the site is really coming along. slowly but getting there :)
 
Yes, the book above is one of the best I've come across for focussed tutorials on making things move. It's by FriendsofED publishing. It's a bit dry and lots of maths, but the animation possibilities that open up are awesome. Some of my best work resulted form studying that book.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.