Flint Particle System Forum - createPixelParticlesFromBitmapData2010-11-24T23:35:04+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
createPixelParticlesFromBitmapDatahttp://flintparticles.org/forum/comments.php?DiscussionID=247&Focus=879#Comment_8792009-07-31T20:37:37+01:002009-07-31T20:43:09+01:00kairoshttp://flintparticles.org/forum/account.php?u=232
First of all many thanks for the great job done! I'm working with flint for the past weeks and I'm surprising with some nice features such as the transformation of a bitmap into ...
However, I can't use "createPixelParticlesFromBitmapData", always receive this error:
----- TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChildAt() at org.flintparticles.twoD.renderers::DisplayObjectRenderer/addParticle() at org.flintparticles.common.renderers::SpriteRendererBase/addEmitter() at party_fla::MainTimeline/frame1()
------
The exact code is this:]]>
createPixelParticlesFromBitmapDatahttp://flintparticles.org/forum/comments.php?DiscussionID=247&Focus=880#Comment_8802009-07-31T20:40:34+01:002009-07-31T20:42:53+01:00kairoshttp://flintparticles.org/forum/account.php?u=232
var c:BitmapData=new BitmapData(ximage,yimage,true,0);
c.draw(mc);
// ERROR!!!
//particles=Particle2DUtils.createPixelParticlesFromBitmapData(c,emitter.particleFactory,0,0);
// ...
var c:BitmapData=new BitmapData(ximage,yimage,true,0); c.draw(mc);
var xa:Number=-200; var ya:Number=yimage/2; var moving = new Move (); var explode=new Explosion(8,xa,ya,500); function action( ev:MouseEvent ):void { if (out) { emitter.start(); emitter.addAction(explode); emitter.addAction(moving); out=false; } else { out=true; emitter.removeAction(explode); emitter.removeAction(moving);
for (var i:uint = 0; i<emitter.particles.length; i++) { TweenLite.to((emitter.particles[i]),1, {x:particles_original[i].x, y:particles_original[i].y} ); } } } function CloneParticleArray(source:Object):* { copy = new ByteArray(); copy.writeObject(source); copy.position=0; return (copy.readObject()); } ]]>
createPixelParticlesFromBitmapDatahttp://flintparticles.org/forum/comments.php?DiscussionID=247&Focus=892#Comment_8922009-08-08T11:16:11+01:002010-11-24T23:35:04+00:00Richardhttp://flintparticles.org/forum/account.php?u=1
Hi
You can only use pixel particles with a PixelRenderer. You're trying to use them with a DisplayObjectRenderer.
Richard
You can only use pixel particles with a PixelRenderer. You're trying to use them with a DisplayObjectRenderer.