Re: [Flashcoders] AS3: accessing loaderInfo.parameters.XXX from non-document class

2009-01-21 Thread Alexander Farber
Hello Glen Ok, it needs to be on stage first - that's why it was null in my tests I still wonder if it's possible to set DEBUG once as _static_ var or const? Regards Alex On Wed, Jan 21, 2009 at 9:13 PM, Glen Pike wrote: > I think you can use this.stage.loaderInfo, but your Sprite needs to b

Re: [Flashcoders] Garbage Collection difficulty

2009-01-21 Thread Glen Pike
Hi, I think if you use it locally, you still have to "dispose" of it: http://www.bartclaessens.com/tag/memory-management/ http://labs.bigspaceship.com/2007/02/28/flash-performance-tips-part-ii/ http://www.gskinner.com/blog/archives/2006/06/as3_resource_ma.html Search for "dispo

Re: [Flashcoders] AS3: accessing loaderInfo.parameters.XXX from non-document class

2009-01-21 Thread Glen Pike
Hi, I think you can use this.stage.loaderInfo, but your Sprite needs to be on stage before you can use the stage parameter. For example: private function _addedToStageHandler(event:Event):void { trace("BackgroundAudio::_addedToStageHandler " + this.stage.loaderInfo.url);

Re: [Flashcoders] Using an accessor for a singleton instance

2009-01-21 Thread Ian Thomas
I use .instance (accessor) instead of getInstance(). No reason not to in AS3. The only reason it's getInstance() really is that that's the Java singleton convention, and that's where a lot of pattern-aware coders started out... Ian On Wed, Jan 21, 2009 at 3:35 PM, allandt bik-elliott (thefieldco

Re: [Flashcoders] Using an accessor for a singleton instance

2009-01-21 Thread allandt bik-elliott (thefieldcomic.com)
cheers mate On Wed, Jan 21, 2009 at 4:47 PM, Alan Shaw wrote: > I actually prefer your usage. The reason not to use it would be that > 'everybody' expects to use getInstance(). > > -A > > > On Wed, Jan 21, 2009 at 10:35 AM, allandt bik-elliott (thefieldcomic.com) > < > alla...@gmail.com> wrote:

Re: [Flashcoders] Using an accessor for a singleton instance

2009-01-21 Thread Alan Shaw
I actually prefer your usage. The reason not to use it would be that 'everybody' expects to use getInstance(). -A On Wed, Jan 21, 2009 at 10:35 AM, allandt bik-elliott (thefieldcomic.com) < alla...@gmail.com> wrote: > Does anyone know of any reason not to use an accessor in my singleton > inst

[Flashcoders] Using an accessor for a singleton instance

2009-01-21 Thread allandt bik-elliott (thefieldcomic.com)
Does anyone know of any reason not to use an accessor in my singleton instead of a function? so would this work okay (bearing in mind - as2) class com.publicis.hp.NavData { private static var _instance:Data; public var myVar:String; private function Data() { trace("This

[Flashcoders] AS3: accessing loaderInfo.parameters.XXX from non-document class

2009-01-21 Thread Alexander Farber
Hello flash coders, in my document class I check loaderInfo.parameters.debug: public class MyGame extends Sprite { public static const DEBUG:Boolean = loaderInfo.parameters.debug; public static const SERVER:String = DEBUG ? 'http://192.168.111.43' : 'http://preferans.de';

RE: [Flashcoders] Garbage Collection difficulty

2009-01-21 Thread Sander Schuurman
That's a local variable right? Doesn't it happen automatic? I must concentrate on the _large Sprite, isn't it? -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike Sent: Wednesday, 21 January 2009 12:

Re: [Flashcoders] Garbage Collection difficulty

2009-01-21 Thread Glen Pike
Hi, Do you have to destroy the Bitmap you create in the largeLoaded function??? Glen Sander Schuurman wrote: Hi cool list, I'm struggling with my Image class. It's supposed to load and unload different sized images dynamicly; but I can't seem to get it to work properly. The loa

[Flashcoders] Garbage Collection difficulty

2009-01-21 Thread Sander Schuurman
Hi cool list, I'm struggling with my Image class. It's supposed to load and unload different sized images dynamicly; but I can't seem to get it to work properly. The loading works fine, but the unloading not for the full 100%. It visually unloads the image, but it remains in the memory. I have