18 March 2008

Use Weak References for Your Event Listeners

Please read this:

http://www.gskinner.com/blog/archives/2006/07/ as3_weakly_refe.html

Using weakly referenced event listeners means an object can be cleared during Garbage Collection even if there's an event listener acting upon it.

It's very useful when you're spawning / deleting a lot of objects, in my case bubble "bullets" that I'm firing at targets underwater.

It saved my bacon (and my forehead) as I've been banging my head on my desk wondering why objects I thought I'd removed still persisted in memory.

The fact it's not a default setting and not very well explained, nor is its importance highlighted (this should be stapled to the front of the Flash CS3/Flex DVD box), is bloody annoying.

Thanks Grant.

1 comments:

wow gold said...

Weekends to peopleig2tmean that they can have a two-day wowgold4europe good rest. For example, people gameusdcan go out to enjoy themselves or get meinwowgoldtogether with relatives and friends to talk with each storeingameother or watch interesting video tapes with the speebiewhole family.
Everyone spends agamegoldweekends in his ownmmoflyway. Within two days,some people can relax themselves by listening to music, reading novels,or watchingogeworld films. Others perhaps are more active by playing basketball,wimming ormmorpgvipdancing. Different people have different gamesavorrelaxations.
I often spend weekends withoggsalemy family or my friends. Sometimes my parents take me on a visit to their old friends. Sometimesgamersell I go to the library to study or borrow some books tommovirtexgain much knowledge. I also go to see various exhibition to broadenrpg tradermy vision. An excursion to seashore or mountain resorts is my favorite way of spending weekends. Weekends are always enjoyable for me.
igxe swagvaultoforu wowgold-usaignmax wowgoldlivebrogame thsaleGoldRockU