Flint Particle System Forum - HELP!! ERROR WHEN I TRY TO USE IMAGE IN PARTICLE Sun, 13 Jun 2010 09:19:09 +0100 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.4 & Feed Publisher HELP!! ERROR WHEN I TRY TO USE IMAGE IN PARTICLE http://flintparticles.org/forum/comments.php?DiscussionID=147&Focus=590#Comment_590 http://flintparticles.org/forum/comments.php?DiscussionID=147&Focus=590#Comment_590 Mon, 29 Dec 2008 18:56:19 +0000 luigicoria
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 http://flintparticles.org/forum/comments.php?DiscussionID=147&Focus=599#Comment_599 Wed, 07 Jan 2009 08:20:54 +0000 Richard HELP!! ERROR WHEN I TRY TO USE IMAGE IN PARTICLE http://flintparticles.org/forum/comments.php?DiscussionID=147&Focus=605#Comment_605 http://flintparticles.org/forum/comments.php?DiscussionID=147&Focus=605#Comment_605 Wed, 07 Jan 2009 19:47:19 +0000 luigicoria thanks anyway ]]>