Flint Particles in Flex
26th June 2009
I released version 2.1 of Flint yesterday. This version features a number of small changes and a couple of major ones. You can read about all the changes on the Flint website, but I want to talk about the biggest change here. Flint now has full support and integration with the Flex Framework.
This means that all Flint’s renderer’s have Flex Framework compatible counterparts that extend UIComponent and that particle effects can be created with MXML code.
So, for example, a snow effect can be created like this
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:f="http://flintparticles.org/2009/flint2d"
layout="absolute" width="600" height="400">
<mx:Script>
<![CDATA[
import org.flintparticles.common.displayObjects.RadialDot;
]]>
</mx:Script>
<mx:Image source="@Embed(source='assets/Snow_1.png')"/>
<f:DisplayObjectRenderer id="renderer" width="600" height="400">
<f:emitters>
<f:Emitter id="emitter" autoStart="true" runAheadTime="10">
<f:counter>
<f:Steady rate="150"/>
</f:counter>
<f:initializers>
<f:Position>
<f:LineZone startX="-5" startY="-5" endX="605" endY="-5"/>
</f:Position>
<f:Velocity>
<f:PointZone x="0" y="65"/>
</f:Velocity>
<f:ImageClass imageClass="{RadialDot}" parameters="{[2]}"/>
<f:ScaleImageInit minScale="0.75" maxScale="2"/>
</f:initializers>
<f:actions>
<f:Move/>
<f:DeathZone zoneIsSafe="true">
<f:RectangleZone left="-10" right="620"
top="-10" bottom="420"/>
</f:DeathZone>
<f:RandomDrift driftX="20" driftY="20"/>
</f:actions>
</f:Emitter>
</f:emitters>
</f:DisplayObjectRenderer>
<mx:Image source="@Embed(source='assets/Snow_1_over.png')"/>
</mx:Application>
Which produces this swf
Flash required: You need version 9 or later of the free Flash player from Adobe to use this content. To download and install the free player from Adobe's web site click here.
All the examples in the Flint project are now available in at least three forms – Flash, PureAS3, and Flex.

5 Comments add your own
good stuff, heres an example of a Flint2D viewStackEffect
http://www.efflex.org/examples/org/efflex/spark/viewStackEffects/Flint2D/
Tink | 29th June 2009 at 09:02
Hi Richard
Thanks for the Flex implementation of Flint, really helps a whole lot with this.
I have a question please. Is it possible to create an effect using this new version to act as an effect of transition (i.e. buttonBar clicked, then effect takes place, maybe simple firework, then next item is displayed)
Would this be possible?
Thanks Richard
Cheers
Al | 25th August 2009 at 23:42
Hi Al
That would be possible. It is worth exploring Tink’s Efflex project first since he’s been working to integrate Flint into that. If Efflex + Flint can do what you’re after it would likely be easier than doing it yourself with Flint alone.
Richard | 26th August 2009 at 07:51
Hi everybody… iv’e tried to “run” this code with mxml for flex 2 sdk and flex 4 sdk beta2 on a debian linux machine and i havent had succeded yet … this is the error i’ve got:
—-
Error: No se pudo resolver en una implementación de componentes.
/home/debian-administrador/Desktop/flex development/Snowfall.mxml(17): Error: No se pudo resolver en una implementación de componentes.
—-
its in spanish cause thats my mother languaje so thats the languaje of the pc where im running the code.. could please anyone help me with this issue please..
my email its notengoemail_6@hotmail.com.
Thanxs and regards.
Note: i believe the problem could be the xmlns:f=”http://flintparticles.org/2009/flint2d” but i havent even a clue to solve the problem.
ogneton | 4th December 2009 at 18:46
sorry its me again … the text of error was vanished when i copied it to the box and i didnt notices at time… once again this is the error ive got:
Error: No se pudo resolver f:DisplayObjectRenderer en una implementacion de componentes
Error: No se pudo resolver f:Emitter en una implementacion de componentes.
it basically saids “it cant solve the f:Emiitter in a implementation of the component” … i think…
thanxs
ogneton | 4th December 2009 at 18:49
Leave a Comment comment policy
XHTML: you can use these tags - <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>Subscribe to the comments via RSS Feed