Good tips, Michel! Here are my 2c:
Timers take a lot of memory and slow down the performance;
If you want to remove swf file from memory, you must first deactivate it, and then dereference it (from Moock’s blog).
Things to do Before unloading swf file (for Flash CS3 ):
- Tell any loaded .swf child assets to desable themselves.
- Stop any sounds from playing.
- Stop the timeline, if it is currently playing
- Stop any movie clips that are currently playing
- Close any connected network objects, such as instances of Loader, URLLoader, Socket, XMLSocket, LocalConnection, NetConnections, and NetStream.
- Release all references to cameras and microphones.
- Unregister all event listeners in teh .swf (particularly Event.ENTER_FRAME, and mouse and keyboard listeners)
- Stop any currently running intervals (via clearInterval())
- Stop any Timer objects (via the Timer class’s instance method stop())
In Flash CS4 this all can be automatically by calling the Loader class’s new method unloadAndStop().
I don’t use weak reference for listeners, just remove it when I don’t need them anymore. This way if your project is very memory hungry and the garbage collection acually happens you will know you have all necessary Event Listeners in place and not cleaned by garbage collection.
Michel, I think its a great topic you started and I also would love to hear other developers’ opinion on AS3 .
You need a Liquid Layout as I understood. Try this http://www.adobe.com/devnet/flash/articles/liquid_gui.html It’s for non-commercial use only but the artcle itself is very useful.
You can leave a message for the author of the file on item’s page or contact the author directly. I think he knows better how to modify the file.
I can build one for you. Please contact me through my FlashDen page if you are interested.
That was hilarious! I remember learning it at school, that’s just basic math! I must admit the guy didn’t loose his temper all the way through the call. They should’ve pay him instead for teaching math:)
Thanks for your replies, guys! I will try SWF Encrypt 5.0. I know FlashDen doesn’t allow to encrypt the files as they do it themselves, but for all other purposes additional protection won’t hurt:)
Thank you, MBMedia for the advice. I will try it using your method.
Could you recommend some good encryption software for encrypting Flash and code?
I have looked over the net and simply not sure which is best.
I would appreciate if you could share your opinion on this topic.
Whatever is wrong with you, Collis, get better!!! All the best wishes, warm chicken soup (in case you’ve got cold) and greetings from FlashDenners!:)
Very useful thread. I was just having the same problem when adding a child swf into the main movie. I read about the issue on one of the forums a while ago but completely forgot when needed it the most:)
Thanks for heads up on this important topic, MBMedia! You saved my remaining hair from being pulled off completely:)