Flint Particle System Forum - How to call a class from your FLA file? 2010-06-13T07:16:34+01:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher How to call a class from your FLA file? http://flintparticles.org/forum/comments.php?DiscussionID=82&Focus=369#Comment_369 2008-09-08T14:37:34+01:00 2008-09-08T14:37:59+01:00 fs_tigre http://flintparticles.org/forum/account.php?u=63 Hi, I'm new to flint and sort of new to classes. How can I call a class from the .fla file? Lets pretend that I want to use the logo fireworks or the fire and smoke class. How can I call the ...
I'm new to flint and sort of new to classes. How can I call a class from the .fla file? Lets pretend that I want to use the logo fireworks or the fire and smoke class.

How can I call the class from my .fla file?

Is the procedure the same for all classes or some classes require different parameters?

Thanks,
fs_tigre]]>
How to call a class from your FLA file? http://flintparticles.org/forum/comments.php?DiscussionID=82&Focus=373#Comment_373 2008-09-08T19:14:54+01:00 2010-06-13T07:16:34+01:00 Richard http://flintparticles.org/forum/account.php?u=1 You'll find an example of creating the fire and smoke effect and the logofirework effect from a flash file in the examples download. How to call a class from your FLA file? http://flintparticles.org/forum/comments.php?DiscussionID=82&Focus=384#Comment_384 2008-09-09T02:41:47+01:00 2010-06-13T07:16:34+01:00 fs_tigre http://flintparticles.org/forum/account.php?u=63 Hi Richard, Well I was referring more to call the class on a MOUSE_OVER or on some other event. Thanks, fs_tigre
Well I was referring more to call the class on a MOUSE_OVER or on some other event.

Thanks,
fs_tigre]]>
How to call a class from your FLA file? http://flintparticles.org/forum/comments.php?DiscussionID=82&Focus=386#Comment_386 2008-09-09T08:39:52+01:00 2010-06-13T07:16:34+01:00 Richard http://flintparticles.org/forum/account.php?u=1 Using Flint is like using any other classes in Flash. If you're not experienced with classes. With version 2, all the examples have two very different versions. The flash examples use frame scripts ... How to call a class from your FLA file? http://flintparticles.org/forum/comments.php?DiscussionID=82&Focus=388#Comment_388 2008-09-09T12:44:28+01:00 2010-06-13T07:16:34+01:00 fs_tigre http://flintparticles.org/forum/account.php?u=63 Thanks How to call a class from your FLA file? http://flintparticles.org/forum/comments.php?DiscussionID=82&Focus=393#Comment_393 2008-09-09T13:48:03+01:00 2010-06-13T07:16:34+01:00 Richard http://flintparticles.org/forum/account.php?u=1 Also, if you're using 1.0.4 you can take the code from the class constructor and place it in a frame script (or an event handler), along with all the variable declarations and import statements, and ... gravity wells example as a frame script is

import flash.display.Sprite;
import flash.filters.BlurFilter;
import flash.filters.ColorMatrixFilter;
import flash.geom.Point;

import org.flintparticles.actions.*;
import org.flintparticles.counters.*;
import org.flintparticles.emitters.Emitter;
import org.flintparticles.initializers.*;
import org.flintparticles.renderers.*;
import org.flintparticles.zones.*;

var emitter:Emitter;
emitter = new Emitter();
emitter.counter = new Blast( 4000 );

emitter.addInitializer( new ColorInit( 0xFFFF00FF, 0xFF00FFFF ) );
emitter.addInitializer( new Position( new DiscZone( new Point( 200, 200 ), 200 ) ) );

emitter.addAction( new Move() );
emitter.addAction( new GravityWell( 25, 200, 200 ) );
emitter.addAction( new GravityWell( 25, 75, 75 ) );
emitter.addAction( new GravityWell( 25, 325, 325 ) );
emitter.addAction( new GravityWell( 25, 75, 325 ) );
emitter.addAction( new GravityWell( 25, 325, 75 ) );

var renderer:PixelRenderer = new PixelRenderer();
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.99,0 ] ) );
emitter.renderer = renderer;
addChild( renderer );

emitter.start();
]]>