Flint Particle System Forum - addAction method breaking my swf Sun, 16 Oct 2011 22:06:59 +0100 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher addAction method breaking my swf http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1694#Comment_1694 http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1694#Comment_1694 Wed, 10 Aug 2011 03:57:18 +0100 dorkbot
thanks! ]]>
addAction method breaking my swf http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1695#Comment_1695 http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1695#Comment_1695 Wed, 10 Aug 2011 04:22:21 +0100 dorkbot
For my first attempt I had copied and pasted the code from the webpage into AS files from the fireworks example: http://flintparticles.org/examples/firework-display-3d That caused the ReferenceError. Then I downloaded the examples from here: http://flintparticles.org/source-code.

It looks like Flint breaks all of my embed and linkage content in my library. I get a list of errors all of which are VerifyError: Error #1014: and ReferenceError: Error #1065:

In both cases I'm not even initiating an instance, I'm just declaring it like this: private var fireworks:Fireworks; Doing this breaks my project. ]]>
addAction method breaking my swf http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1696#Comment_1696 http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1696#Comment_1696 Wed, 10 Aug 2011 04:55:34 +0100 dorkbot
package
{
import org.flintparticles.common.emitters.Emitter;
import org.flintparticles.common.events.EmitterEvent;
import org.flintparticles.common.events.ParticleEvent;
import org.flintparticles.threeD.emitters.Emitter3D;
import org.flintparticles.threeD.particles.Particle3D;
import org.flintparticles.threeD.renderers.BitmapRenderer;
import org.flintparticles.threeD.renderers.controllers.FirstPersonCamera;
import org.flintparticles.threeD.zones.LineZone;

import flash.display.Sprite;
import flash.filters.BlurFilter;
import flash.filters.ColorMatrixFilter;
import flash.geom.Rectangle;
import flash.geom.Vector3D;

public class Fireworks extends Sprite
{
private var orbitter:FirstPersonCamera;
private var renderer:BitmapRenderer;

public function Fireworks()
{
renderer = new BitmapRenderer( new Rectangle( -400, -300, 800, 600 ), false );
renderer.x = 400;
renderer.y = 300;
renderer.addFilter( new BlurFilter( 2, 2, 1 ) );
renderer.addFilter( new ColorMatrixFilter( [ 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0.95,0 ] ) );
addChild( renderer );

renderer.camera.position = new Vector3D( 0, -150, -400 );
renderer.camera.target = new Vector3D( 0, -150, 0 );
renderer.camera.projectionDistance = 400;
orbitter = new FirstPersonCamera( stage, renderer.camera );
orbitter.start();

var emitter:Emitter3D = new Whizzer( new LineZone( new Vector3D( -200, 0, 0 ), new Vector3D( 200, 0, 0) ) );
renderer.addEmitter( emitter );
emitter.addEventListener( ParticleEvent.PARTICLE_DEAD, whizzBang, false, 0, true );
emitter.start();
}

public function whizzBang( ev:ParticleEvent ):void
{
var bang:Emitter3D = new SphereBang( Particle3D( ev.particle ).position );
bang.addEventListener( EmitterEvent.EMITTER_EMPTY, removeEmitter, false, 0, true );
renderer.addEmitter( bang );
bang.start();
}

public function removeEmitter( ev:EmitterEvent ):void
{
Emitter3D( ev.target ).removeEventListener( EmitterEvent.EMITTER_EMPTY, removeEmitter );
renderer.removeEmitter( Emitter3D( ev.target ) );
}

public function destroy():void
{
for each( var e:Emitter in renderer.emitters )
{
e.stop();
}
}
}
}

package
{
import org.flintparticles.common.actions.Age;
import org.flintparticles.common.counters.Steady;
import org.flintparticles.common.displayObjects.Dot;
import org.flintparticles.common.initializers.ColorInit;
import org.flintparticles.common.initializers.Lifetime;
import org.flintparticles.common.initializers.SharedImage;
import org.flintparticles.threeD.actions.Accelerate;
import org.flintparticles.threeD.actions.LinearDrag;
import org.flintparticles.threeD.actions.Move;
import org.flintparticles.threeD.actions.RandomDrift;
import org.flintparticles.threeD.emitters.Emitter3D;
import org.flintparticles.threeD.initializers.Position;
import org.flintparticles.threeD.initializers.Velocity;
import org.flintparticles.threeD.zones.ConeZone;
import org.flintparticles.threeD.zones.Zone3D;

import flash.geom.Vector3D;

public class Whizzer extends Emitter3D
{
public function Whizzer( zone:Zone3D )
{
counter = new Steady( 0.5 );

addInitializer( new SharedImage( new Dot( 4 ) ) );
addInitializer( new ColorInit( 0xFFFFFF00, 0xFFFF6600 ) );
addInitializer( new Position( zone ) );
addInitializer( new Velocity( new ConeZone( new Vector3D(), new Vector3D( 0, -1, 0 ), 0.1, 350, 330 ) ) );
addInitializer( new Lifetime( 3.3 ) );

addAction( new Age() );
addAction( new Move() );
addAction( new Accelerate( new Vector3D( 0, 50, 0 ) ) );
addAction( new LinearDrag( 0.5 ) );
addAction( new RandomDrift( 10, 10, 10 ) );
}
}
}

package
{
import org.flintparticles.common.actions.Age;
import org.flintparticles.common.actions.Fade;
import org.flintparticles.common.counters.Blast;
import org.flintparticles.common.displayObjects.Dot;
import org.flintparticles.common.easing.Quadratic;
import org.flintparticles.common.initializers.ColorInit;
import org.flintparticles.common.initializers.Lifetime;
import org.flintparticles.common.initializers.SharedImage;
import org.flintparticles.threeD.actions.Accelerate;
import org.flintparticles.threeD.actions.LinearDrag;
import org.flintparticles.threeD.actions.Move;
import org.flintparticles.threeD.emitters.Emitter3D;
import org.flintparticles.threeD.initializers.Position;
import org.flintparticles.threeD.initializers.Velocity;
import org.flintparticles.threeD.zones.PointZone;
import org.flintparticles.threeD.zones.SphereZone;

import flash.geom.Vector3D;

public class SphereBang extends Emitter3D
{
public function SphereBang( position:Vector3D )
{
counter = new Blast( 200 );

addInitializer( new SharedImage( new Dot( 1 ) ) );
addInitializer( new ColorInit( 0xFFFFFF00, 0xFFFF6600 ) );
addInitializer( new Position( new PointZone( position ) ) );
addInitializer( new Velocity( new SphereZone( new Vector3D(), 100 ) ) );
addInitializer( new Lifetime( 3 ) );

addAction( new Age( Quadratic.easeIn ) );
addAction( new Move() );
addAction( new Fade() );
addAction( new Accelerate( new Vector3D( 0, 50, 0 ) ) );
addAction( new LinearDrag( 0.5 ) );
}
}
} ]]>
addAction method breaking my swf http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1697#Comment_1697 http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1697#Comment_1697 Wed, 10 Aug 2011 05:15:50 +0100 dorkbot
Comment this out in the Class Fireworks:

/*renderer.addEmitter( emitter );
emitter.addEventListener( ParticleEvent.PARTICLE_DEAD, whizzBang, false, 0, true );
emitter.start();*/

/*var bang:Emitter3D = new SphereBang( Particle3D( ev.particle ).position );
bang.addEventListener( EmitterEvent.EMITTER_EMPTY, removeEmitter, false, 0, true );
renderer.addEmitter( bang );
bang.start();*/

And this in the Class Whizzer:

/*addAction( new Age() );
addAction( new Move() );
addAction( new Accelerate( new Vector3D( 0, 50, 0 ) ) );
addAction( new LinearDrag( 0.5 ) );
addAction( new RandomDrift( 10, 10, 10 ) );*/ ]]>
addAction method breaking my swf http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1699#Comment_1699 http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1699#Comment_1699 Fri, 19 Aug 2011 10:58:05 +0100 Richard addAction method breaking my swf http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1712#Comment_1712 http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1712#Comment_1712 Thu, 01 Sep 2011 02:35:14 +0100 dorkbot
http://bangersandflash.net/wtf-5005-unknown-error-optimizing-byte-code/

I haven't had time to test it tho. I had another issue with adding some more classes, then found this and I was able to fix my issue. I assume it will have fixed my FLINT issue as well.

cheers. ]]>