Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in PooledDisplayObjectClass.as #13

Open
GoogleCodeExporter opened this issue Sep 14, 2015 · 0 comments
Open

Crash in PooledDisplayObjectClass.as #13

GoogleCodeExporter opened this issue Sep 14, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

First of all many thanks for sharing this work. Understand development of 
Stardust is no longer active, but thought I'd report this issue and a suggested 
solution in case anyone else encounters it. I am using version 1.3 of Stardust 
Particles.

Steps to reproduce:
1. write a class ("SimpleCircle") extending Sprite that takes 2 required 
constructor params (a color and a radius) which are used to draw a circle in 
the graphics of the SimpleCircle using Flash drawing API. 
2. create a new PooledDisplayObjectClass Initializer instance, passing the 
SimpleCircle Class and an array of the desired colour and radius parameters. 

I expected the PooledDisplayObjectClass to supply SimpleCircle instances of 
that size and color to the emitter in my particle system. Instead, the program 
crashes on run.

Suggested solution:
in the constructor of PooledDisplayObjectClass, replace the lines

26  _pool = new DisplayObjectPool();
27
28  this.displayObjectClass = displayObjectClass;
29  this.constructorParams = constructorParams;

with

26  _pool = new DisplayObjectPool();
27
28  _displayObjectClass = displayObjectClass;
29  _constructorParams = constructorParams;
30  if (_displayObjectClass) _pool.reset(_displayObjectClass, 
_constructorParams);

This would allow the constructor to run successfully.

Original issue reported on code.google.com by [email protected] on 9 Feb 2015 at 2:51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant