Best practices demo project

9 views
Skip to first unread message

sventunus

unread,
Dec 3, 2010, 10:42:25 AM12/3/10
to Temple Library
Hi guys,

I was just recently introduced to the Temple library @ augxl, and was
quite impressed with the way it simplifies memory management. If I
read the documentation well, automatic destruction is only available
for displayobjects, so it's still up to the developer to nullify all
class members that are not displayobjects before calling destruct on a
class instance?
Do I even HAVE to call destruct on, say, an instance of a class
extending from CoreSprite, before removing it from a view, or does the
"destructOnUnload" property handle this automatically in a
REMOVED_FROM_STAGE event handler?

I would really love to see a simple demo project that illustrates best
practices for using the temple library. Some simple project that
constructs 3 views, each of which contain some sort of visual children
(for instance: one loads in a netstream, another loads some pictures
and contains buttons to open external links in the browser, and a
third that draws some things with the drawing API), and allows adding/
removing these views to the stage and navigating between them.

It seems to me this would cost you guys less that 15 minutes to build,
and I'm sure it would clarify many things about the Temple to many
people. Maybe worth a blog post?
I really hope you would consider this, as I'm sure it would draw many
more people into using your library.

Kind regards,
Sven

Thijs [ :: MediaMonks :: ]

unread,
Dec 7, 2010, 10:52:05 AM12/7/10
to temple...@googlegroups.com
Hi Sven,

Automatically destruction only works for DisplayObjects, which are on the stage (so they can be reached by 'getChildAt'). All other objects must be destructed (and nullified) manually. Also destruct is only automatically called on unload, not on REMOVED_FROM_STAGE. But destruct also removes the object from the stage, so you can that instead of 'removeChild'.

And adding some demo projects is a good idea. We already had some plans to do so, but we did not have the time to do it. We are currently very busy on projects (December is always a busy month), but hopefully we can make some time for this soon.

Regards,

Thijs

Reply all
Reply to author
Forward
0 new messages