Fork me on GitHub
Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

    • CommentAuthordorkbot
    • CommentTimeAug 10th 2011 edited
     
    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 my swf will work. I'm using the pure AS3 version. Any ideas?

    thanks!
    • CommentAuthordorkbot
    • CommentTimeAug 10th 2011 edited
     
    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 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.
    • CommentAuthordorkbot
    • CommentTimeAug 10th 2011
     
    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 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 ) );
    }
    }
    }
    • CommentAuthordorkbot
    • CommentTimeAug 10th 2011
     
    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, 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 ) );*/
    • CommentAuthorRichard
    • CommentTimeAug 19th 2011
     
    Have you added the Flint library to your classpath? Are you using Flash CS4 or later?
    • CommentAuthordorkbot
    • CommentTimeSep 1st 2011
     
    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 classes, then found this and I was able to fix my issue. I assume it will have fixed my FLINT issue as well.

    cheers.