Flint Particle System Forum - addAction method breaking my swf 2011-10-16T22:12:39+01:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher addAction method breaking my swf http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1694#Comment_1694 2011-08-10T03:57:18+01:00 2011-08-10T04:13:55+01:00 dorkbot http://flintparticles.org/forum/account.php?u=532 I can get the fireworks demo to work on its own in a swf. But when I add it to my large project it breaks it. I get this error: ReferenceError: Error #1065. When I comment out the addAction calls ...
thanks!]]>
addAction method breaking my swf http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1695#Comment_1695 2011-08-10T04:22:21+01:00 2011-08-10T06:17:14+01:00 dorkbot http://flintparticles.org/forum/account.php?u=532 Update: 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 ...
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 2011-08-10T04:55:34+01:00 2011-10-16T22:12:39+01:00 dorkbot http://flintparticles.org/forum/account.php?u=532 Below are my classes, but they are almost exactly the same as the example, I'm just not using a document class. package { import org.flintparticles.common.emitters.Emitter; import ...
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 2011-08-10T05:15:50+01:00 2011-10-16T22:12:39+01:00 dorkbot http://flintparticles.org/forum/account.php?u=532 When I comment the below out my project will work. Comment this out in the Class Fireworks: /*renderer.addEmitter( emitter ); emitter.addEventListener( ParticleEvent.PARTICLE_DEAD, whizzBang, ...
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 2011-08-19T10:58:05+01:00 2011-10-16T22:12:39+01:00 Richard http://flintparticles.org/forum/account.php?u=1 Have you added the Flint library to your classpath? Are you using Flash CS4 or later? addAction method breaking my swf http://flintparticles.org/forum/comments.php?DiscussionID=507&Focus=1712#Comment_1712 2011-09-01T02:35:14+01:00 2011-10-16T22:12:39+01:00 dorkbot http://flintparticles.org/forum/account.php?u=532 I believe it had something to do with this: 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 ...
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.]]>