Flint Particle System Forum - about MouseEvent2011-12-13T03:30:29+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
about MouseEventhttp://flintparticles.org/forum/comments.php?DiscussionID=396&Focus=1339#Comment_13392010-09-13T15:38:11+01:002010-09-13T15:38:39+01:00RobChttp://flintparticles.org/forum/account.php?u=407
Hi, exscuse for my English,
I have this problem: I want to add a MouseEvent in this simple code just to trigger the particles movement:
[SWF(width="500", height="500", ...
I have this problem: I want to add a MouseEvent in this simple code just to trigger the particles movement:
I know that this addEventListener does nothing but I would know what is the right way. Thank!]]>
about MouseEventhttp://flintparticles.org/forum/comments.php?DiscussionID=396&Focus=1350#Comment_13502010-09-14T21:14:06+01:002011-12-13T03:30:29+00:00Ubuntuhttp://flintparticles.org/forum/account.php?u=387
I guess this does not work because the emitter is not a clickable sprite or movieclip. If you want this to work when you click anywhere on the stage then try ...
stage.addEventListener(MouseEvent.CLICK, movement);]]>
about MouseEventhttp://flintparticles.org/forum/comments.php?DiscussionID=396&Focus=1354#Comment_13542010-09-16T08:49:15+01:002011-12-13T03:30:29+00:00Richardhttp://flintparticles.org/forum/account.php?u=1
Exactly. Use any clickable object to trigger the event, including the stage. The emitter is not clickable.
The particles can be made clickable -
render.mouseEnabled = ...
The particles can be made clickable -
render.mouseEnabled = true; render.mouseChildren = true; render.addEventListener(MouseEvent.CLICK, movement);]]>
about MouseEventhttp://flintparticles.org/forum/comments.php?DiscussionID=396&Focus=1356#Comment_13562010-09-16T09:41:19+01:002010-09-16T09:54:34+01:00RobChttp://flintparticles.org/forum/account.php?u=407
Thank guys! But I tried with this code and nothing happens:
render.mouseEnabled = true;
render.mouseChildren = true;
render.addEventListener(MouseEvent.CLICK, movement);
function ...
render.mouseEnabled = true; render.mouseChildren = true;
I don't understand why....]]>
about MouseEventhttp://flintparticles.org/forum/comments.php?DiscussionID=396&Focus=1357#Comment_13572010-09-16T10:10:43+01:002011-12-13T03:30:29+00:00RobChttp://flintparticles.org/forum/account.php?u=407
Ok, I understand that I have to put the emitter.start() inside the function but, in this way, before the click there arent any particles on the stage.
What I want, if possible, is to start the ...
emitter.start() inside the function but, in this way, before the click there arent any particles on the stage. What I want, if possible, is to start the movement of the particles when they are just on the stage....]]>
about MouseEventhttp://flintparticles.org/forum/comments.php?DiscussionID=396&Focus=1359#Comment_13592010-09-16T11:56:07+01:002011-12-13T03:30:29+00:00Richardhttp://flintparticles.org/forum/account.php?u=1
Don't put the emitter.start() inside the function, but do put the emitter.addAction(new Move()) inside it. The particles won't move until you add this action to the emitter.
about MouseEventhttp://flintparticles.org/forum/comments.php?DiscussionID=396&Focus=1362#Comment_13622010-09-16T16:19:54+01:002011-12-13T03:30:29+00:00RobChttp://flintparticles.org/forum/account.php?u=407
I tried to leave out the function emitter.start() and just put the emitter.addAction(new Move()) inside it (like the example in my post before) but the particles doesn't move after the click.
about MouseEventhttp://flintparticles.org/forum/comments.php?DiscussionID=396&Focus=1363#Comment_13632010-09-17T07:13:47+01:002011-12-13T03:30:29+00:00Richardhttp://flintparticles.org/forum/account.php?u=1
In your previous example, you should move the velocity initializer out of the function. Basically, you set the emitter up with all its initializers, including velocity. Then you start it, causing the ...
about MouseEventhttp://flintparticles.org/forum/comments.php?DiscussionID=396&Focus=1364#Comment_13642010-09-17T12:17:42+01:002011-12-13T03:30:29+00:00RobChttp://flintparticles.org/forum/account.php?u=407
Really thank you Richard!
Now is all ok, very good explanation!
Now is all ok, very good explanation!]]>