Flint Particle System Forum - How to change position of particle after emitter is already made? Tue, 13 Dec 2011 15:44:24 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher How to change position of particle after emitter is already made? http://flintparticles.org/forum/comments.php?DiscussionID=308&Focus=1064#Comment_1064 http://flintparticles.org/forum/comments.php?DiscussionID=308&Focus=1064#Comment_1064 Fri, 22 Jan 2010 17:41:50 +0000 xraven13 Now i am wondering how to move position of that particle around so that it follows for example some position or actually and place on screen i want...
I would like to set x and y of that particle so that he appears there...
In DotEmitter class i have this variable :
public var point:PointZone = new PointZone(new Point(335,100));
And i initilize it like this :
addInitializer( new Position(point));
So when i make instance i tried changing position of particle like this :
emitter.point.point.x = 500;
But particle didn't move at that position!!!
When i trace emitter.point.point.x i got 500!!! So particle is at that position but it seems he didn't update??
So i tried using emitter.update etc but nothing happened..
What i am doing wrong?
Thx in advance for help! ]]>
How to change position of particle after emitter is already made? http://flintparticles.org/forum/comments.php?DiscussionID=308&Focus=1072#Comment_1072 http://flintparticles.org/forum/comments.php?DiscussionID=308&Focus=1072#Comment_1072 Mon, 25 Jan 2010 08:12:11 +0000 Richard
The position initializer sets the position of new particles, it doesn't change the position of existing particles. Initializers set the propertioes of new particles when they are created, while Actions alter properties of existing particles. There isn't an action to manually set the position of existing particles, but you may be able to get what you need using a TweenToZone action with your PointZone and adjusting the time in the TweenToZone to get it there quickly.

Richard ]]>
How to change position of particle after emitter is already made? http://flintparticles.org/forum/comments.php?DiscussionID=308&Focus=1075#Comment_1075 http://flintparticles.org/forum/comments.php?DiscussionID=308&Focus=1075#Comment_1075 Mon, 25 Jan 2010 08:50:10 +0000 xraven13 BTW i am adding width and height to make that particle is at same place where my sprite is .. So if you don't want something like that just remove width and height..

package org.flintparticles.twoD.actions
{
import org.flintparticles.common.actions.Action;
import org.flintparticles.common.actions.ActionBase;
import org.flintparticles.common.emitters.Emitter;
import org.flintparticles.common.particles.Particle;
import org.flintparticles.twoD.particles.Particle2D;
import flash.geom.Point;

public class MoveTo extends ActionBase
{
public var x:Number;
public var y:Number;
public var width:Number;
public var height:Number;

public function MoveTo(_x:Number=0,_y:Number=0,_width:Number=0,_height:Number=0)
{

this.x = _x;
this.y = _y;
this.width = _width/2;
this.height = _height/2;


}


override public function update( emitter:Emitter, particle:Particle, time:Number ):void
{
var p:Particle2D = Particle2D( particle );
p.x = x + width;
p.y = y + height;

}



}

} ]]>