Flint Particle System Forum - HELP!! ERROR WHEN I TRY TO USE IMAGE IN PARTICLE 2010-12-25T19:44:33+00:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher HELP!! ERROR WHEN I TRY TO USE IMAGE IN PARTICLE http://flintparticles.org/forum/comments.php?DiscussionID=147&Focus=590#Comment_590 2008-12-29T18:56:19+00:00 2010-12-25T19:44:33+00:00 luigicoria http://flintparticles.org/forum/account.php?u=111 Hello, i have my own engine, and tried to embbeb Flint engine. It works Fine when i use the basic particle, but when i try to use an Image, i get a null value in my object. i use a ...
i use a LoaderResourses Manager as Class type, but by now is impossible to run it

i post the code so you can help me about that:



///////////////////////////////////////////////////
CLASS PARTICLE
/////////////////////////////////////////////////

public class Particulas extends Emitter2D
{
private var m_ResourcesMgr : ResManager;
private var m_ResLoaded : Res_Loader;
private var m_Variables : Variables;
private var m_p:MovieClip;


public function Particulas()
{
OnEngineStart();
}

public function OnEngineStart():void
{
var Prototype:Class;
m_Variables = Variables.GetInstance();

Prototype = m_ResLoaded.LoadClassMc("Catch"); //-->/// HERE I GOT A NULL VALUE TO THE VARIABLE PROTOTYPE

counter = new Steady(15);

//this.addInitializer( new ImageClass( RadialDot, 4 ) ); //-->THIS WORK FINE!!
this.addInitializer(new ImageClass(Prototype,2)); // --> THIS DOESNT WORK
this.addInitializer( new Position(new LineZone(new Point( 0, 460), new Point(0, 70))));
this.addInitializer( new Velocity( new PointZone( new Point( 40, 0 ) ) ) );
this.addInitializer( new ScaleImageInit( 1, 1 ) );

this.addAction( new Move() );
this.addAction( new DeathZone( new RectangleZone( -10, -10, 620, 620 ), true ) );
this.addAction( new RandomDrift( 15, 15 ) );

this.addAction( new Move() );
this.addAction( new DeathZone( new RectangleZone( -10, -10, 620, 420 ), true ) );
this.addAction( new RandomDrift( 15, 15 ) );

}

public function OnLoad():Boolean
{

m_ResourcesMgr = ResManager.GetInstance();
m_ResourcesMgr.LoadRes(m_Variables.RES_InGame);
m_ResLoaded = m_ResourcesMgr.GetRes(m_Variables.RES_InGame);
m_ResLoaded.addEventListener(Event.COMPLETE, LoadRes);

return true;
}

private function LoadRes(ev:Event) : void
{

//START THE PARTICLE
this.start();
this.runAhead(10);

m_ResLoaded.removeEventListener(Event.COMPLETE, LoadRes);

}


//////////////////////////////////////////////////////////////////////////////////
PART OF THE CLASS RESOURCES LOADER (I GET THE CLASS NAME OF THE MOVIECLIP FROM THE SWF)
HERE I RETURN A VALUE OF CLASS TYPE, USED IN PARTICULA CLASS LATER.
//////////////////////////////////////////////////////////////////////////////////

public function LoadClassMc(name:String):Class
{
if (!appDomain.hasDefinition(name))
{
trace ("error "+name);
return null;
}
return appDomain.getDefinition(name) as Class;]]>
HELP!! ERROR WHEN I TRY TO USE IMAGE IN PARTICLE http://flintparticles.org/forum/comments.php?DiscussionID=147&Focus=599#Comment_599 2009-01-07T08:20:54+00:00 2010-12-25T19:44:33+00:00 Richard http://flintparticles.org/forum/account.php?u=1 This looks like a problem with your class loader. HELP!! ERROR WHEN I TRY TO USE IMAGE IN PARTICLE http://flintparticles.org/forum/comments.php?DiscussionID=147&Focus=605#Comment_605 2009-01-07T19:47:19+00:00 2010-12-25T19:44:33+00:00 luigicoria http://flintparticles.org/forum/account.php?u=111 The problem was solved, the loader class works fine, the problem was in other side thanks anyway thanks anyway]]>