RE: [Flashcoders] Garbage Collection difficulty
Thnx! ran a few tests on a server; and indeed my code is doing great, and the GC occurs when some more memory is needed... thnx again... I think the concept of this GC is key in AS3 development -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Nate Beck Sent: Wednesday, 28 January 2009 17:34 To: Flash Coders List Subject: Re: [Flashcoders] Garbage Collection difficulty Ah yes... I knew I read it somewhere... It's in that Grant Skinner article. *Deferred GC and Indeterminacy* A *very* important thing to understand about the Garbage Collector in FP9 is that it's operations are deferred. Your objects will not be removed immediately when all active references are deleted, instead they will be removed at some indeterminate time in the future (from a developer standpoint). The GC uses a set of heuristics that look at RAM allocation and the size of the memory stack (among other things) to determine when to run. As a developer, you must accept that fact that you will have no way of knowing when (or even if) your inactive objects will get deallocated. You must also be aware that inactive objects will continue to execute indefinitely (until the GC deallocates it), so code will keep running (ex. enterFrames), sounds will keep playing, loads will keep happening, events will keep firing, etc. It's very important to remember that you have no control over when your objects will be deallocated, so you must make them as inert as possible when you are finished with them. Strategies to manage this will be the focus for a future article. On Wed, Jan 28, 2009 at 8:31 AM, Nate Beck n...@tldstudio.com wrote: It was my understanding that Garbage Collection doesn't always occur right away. When you have orphaned objects sitting on the heap, they are * eligible* for garbage collection. That doesn't mean they will be removed from memory right away. Especially if you're testing for JUST that to happen. Usually GC occurs when more memory is needed. Someone else could probably speak to this topic much more intelligently than me.. but that was my understanding of how GC in general works. Cheers On Tue, Jan 27, 2009 at 6:04 AM, Sander Schuurman sander.schuur...@oswaldandruby.com wrote: Thnx for the links... tried some, but still with no success... I now have the following: public class Image extends MovieClip { private var _thumbLoader:Loader; private var _largeLoader:Loader; private var _thumb:Bitmap; private var _large:Bitmap; public function loadThumb() :void { _thumbLoader = new Loader(); _thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded, false, 0, true); _thumbLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorOccured, false, 0, true); _thumbLoader.load(new URLRequest(_tu)); } private function thumbLoaded( e :Event ) :void { _thumb = Bitmap(e.currentTarget.content); _thumb.smoothing = true; addChild(_thumb); _thumbLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, thumbLoaded); _thumbLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, errorOccured); _thumbLoader = null; dispatchEvent(new Event(Image.IMG_LOADED)); } public function loadLarge() :void { _largeLoader = new Loader(); _largeLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, largeLoaded, false, 0, true); _largeLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorOccured, false, 0, true); _largeLoader.load(new URLRequest(_lu)); } private function largeLoaded( e :Event ) :void { _large = e.currentTarget.content; _large.smoothing = true; addChild(_large); _largeLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, largeLoaded); _largeLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, errorOccured); //_largeLoader.content.dispose(); _largeLoader = null; dispatchEvent(new Event(Image.IMG_LOADED)); } public function disposeLarge() :void { if (_large) { removeChild(_large); _large.bitmapData.dispose(); _large = null; } } public function dispose() :void { disposeLarge(); removeChild(_thumb); _thumb.bitmapData.dispose(); _thumb = null } } Anyone some tips? The large bitmap stays in memory... -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto: flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike Sent: Wednesday, 21 January 2009 21:18 To: Flash Coders List Subject: Re: [Flashcoders] Garbage Collection difficulty Hi, I think if you use it locally, you still have to dispose of it: http://www.bartclaessens.com/tag/memory-management/
[Flashcoders] capturing mouse events for layered sprites
Hi there, I have a square sprite that contains a background sprite on one layer with another layer containing various shaped sprites. Each of these sprites is a custom class that gives a mouse event. My problem is that if I capture the mouse_over event for the container sprite for some reason i get the mouse_out and and another mouse_over event each time the mouse runs off one of the smaller sprites and over the background. Is there any way I can avoid this without using the mouse position? Thanks in advance :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading image on local filesystem
use relative path and forward slashes img/image.jpg - Original Message - From: K-Dawg kdaw...@gmail.com To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Thursday, January 29, 2009 1:12 AM Subject: [Flashcoders] Loading image on local filesystem The AS is in a dir1 (dir1\stuff.as) and the images are in dir1\img\image.jpg. imagePath = new URLRequest(this.imagePathString); loader = new Loader(); trace(loader.load(imagePath)); this.imagePathString is a relative path to the image (img\image.jpg). How can I load these from a local filesystem? This will be moved to a web server but for testing I am running on windows and Flash CS3 in Windows XP as a vm on my laptop in VMWare. Thanks for any help. Kevin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] capturing mouse events for layered sprites
you could set mouseChildren = false; on the the container. This way the child mc's won't capture any mouse events. Dennis Isioux - Original Message - From: ali drongo alidro...@googlemail.com To: flashcoders@chattyfig.figleaf.com Sent: Thursday, January 29, 2009 11:21 AM Subject: [Flashcoders] capturing mouse events for layered sprites Hi there, I have a square sprite that contains a background sprite on one layer with another layer containing various shaped sprites. Each of these sprites is a custom class that gives a mouse event. My problem is that if I capture the mouse_over event for the container sprite for some reason i get the mouse_out and and another mouse_over event each time the mouse runs off one of the smaller sprites and over the background. Is there any way I can avoid this without using the mouse position? Thanks in advance :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders __ NOD32 3809 (20090129) Informatie __ Dit bericht is gecontroleerd door het NOD32 Antivirus Systeem. http://www.nod32.nl ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] T-signers.com for sale
Hello everybody, A while ago I mentioned the option of selling T-signers.com on this list. Since then we haven't taken any action, but now the time has come to make a decision. We emailed our users yesterday and I thought it would be nice to give you all a chance to participate. *** Hey friends of T-signers, Things have slowed down lately behind the scenes at T-signers.com; you could even say it’s gotten quiet. And the main reason for this is that we’ve been busy with other things. Jeroen has a busy job as an architect, Gert-Jan renovated his house, and he’ll soon become a dad. Because of this, we’ve made a difficult decision: to stop. But this doesn’t have to mean that T-signers.com ceases to exist. As of now, we are looking for enthusiastic people to take over the business from us. After the acquisition T-signers will be yours to use and improve! For a month or so after, we’ll gladly assist you with advice and even some minor adjustments. The site has been running for over five years now. And during that period more than 10.000 designs have been created stored in our database. This means T-signers.com does have a certain value. And we’ll need to discuss it if you wish to take over the business. But the most important thing for us is that T-signers stays alive and has a great future ahead of it.Do you see a bright future for T-signers? If you’re ready to take on the challenge, please contact us http://www.t-signers.com/blog/?p=34 *** Bye! Gert-Jan___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading image on local filesystem
On Thu, Jan 29, 2009 at 6:51 AM, Muzak p.ginnebe...@telenet.be wrote: use relative path and forward slashes img/image.jpg I'm sorry, I mistyped for some reason. The actual string passed into the URLRequest is: img/food_array.jpg the path is relative and does exist exactly as that. I pass it in through the object's constructor and then do: this.imagePath = new URLRequest(this.imagePathString); loader = new Loader(); loader.load(this.imagePath); loader.contentLoaderInfo.addEventListener(Event.INIT, imageLoaded); When I trace(this.imagePathString); it outputs the correct path and trace(this.imagePath) returns the URLRequest. I must be doing something incorrect on the loader.load line maybe? Thanks. Kevin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading image on local filesystem
What's the error? No image appearing? (You haven't used addChild() anywhere.) imageLoaded() never getting called? (Probably a red herring, but you really should add the listener _before_ you call load()). Give us some more info, then we might be able to help. Ian On Thu, Jan 29, 2009 at 1:30 PM, K-Dawg kdaw...@gmail.com wrote: On Thu, Jan 29, 2009 at 6:51 AM, Muzak p.ginnebe...@telenet.be wrote: use relative path and forward slashes img/image.jpg I'm sorry, I mistyped for some reason. The actual string passed into the URLRequest is: img/food_array.jpg the path is relative and does exist exactly as that. I pass it in through the object's constructor and then do: this.imagePath = new URLRequest(this.imagePathString); loader = new Loader(); loader.load(this.imagePath); loader.contentLoaderInfo.addEventListener(Event.INIT, imageLoaded); When I trace(this.imagePathString); it outputs the correct path and trace(this.imagePath) returns the URLRequest. I must be doing something incorrect on the loader.load line maybe? Thanks. Kevin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Loading image on local filesystem
Are you sure this is not a security error due to the allow network / allow local setting? I'm guessing that you may want to allow local file access for the swf (somewhere in publish settings as I remember), or add the img folder on your local drive to flash's trusted locations. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of K-Dawg Sent: 29 January 2009 13:30 To: Flash Coders List Subject: Re: [Flashcoders] Loading image on local filesystem On Thu, Jan 29, 2009 at 6:51 AM, Muzak p.ginnebe...@telenet.be wrote: use relative path and forward slashes img/image.jpg I'm sorry, I mistyped for some reason. The actual string passed into the URLRequest is: img/food_array.jpg the path is relative and does exist exactly as that. I pass it in through the object's constructor and then do: this.imagePath = new URLRequest(this.imagePathString); loader = new Loader(); loader.load(this.imagePath); loader.contentLoaderInfo.addEventListener(Event.INIT, imageLoaded); When I trace(this.imagePathString); it outputs the correct path and trace(this.imagePath) returns the URLRequest. I must be doing something incorrect on the loader.load line maybe? Thanks. Kevin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading image on local filesystem
What's the error? No image appearing? (You haven't used addChild() anywhere.) Well, what I have my main class, PondoShow that extends Sprite. In here I instantiate a Slide object, passing in a bunch of parameters: slides = new Array(4); slides[0] = new Slide(This is a test, this is only a test, img/food_array.jpg, Click here to find out more, more.html, 100, 100, 50, 50, 200, 200); slides[1] = new Slide(This is a test, this is only a test, img/food_array2.jpg, Click here to find out more, more.html, 100, 100, 50, 50, 200, 200); Inside the slide object constructor I instantiate the variables and then, still inside the constructor of the Slide object: this.imagePath = new URLRequest(this.imagePathString); loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.INIT, imageLoaded); loader.load(this.imagePath); } private function imageLoaded(ev:Event):void { trace(inside imageLoaded function); imgload = true; } My PondoShow class does this: while(true) { if (slides[slideCounter].imgload) { addChild(slides[slideCounter].loader.content); break; } } but in the loop, the if statement is never true, and the imageLoaded function never gets called in the Slide class and eventually the loop times out or I kill it. imageLoaded() never getting called? (Probably a red herring, but you really should add the listener _before_ you call load()). Good idea. Certainly more readable at the very least. Unfortunately changing this did not solve my issue though. Give us some more info, then we might be able to help. Ian Thanks for any help. Kevin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading image on local filesystem
On Thu, Jan 29, 2009 at 8:53 AM, Jim Hayes j...@primalpictures.com wrote: Are you sure this is not a security error due to the allow network / allow local setting? I'm guessing that you may want to allow local file access for the swf (somewhere in publish settings as I remember), or add the img folder on your local drive to flash's trusted locations. In the Publish Settings I see a Local Playback security and it is set to access local files only. Thanks. Kevin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading image on local filesystem
while(true) { if (slides[slideCounter].imgload) { addChild(slides[slideCounter].loader.content); break; } } This is your issue. Flash just doesn't work like this. You are repeatedly executing the code in the while loop, giving Flash no chance to do anything else - update the screen, fire events, anything at all. The correct answer is to listen for the Event.INIT to be fired (as you are doing) and then call your addChild function. I'd really suggest you take a look at some tutorials on Flash's event system. There are plenty around the web - or, better, consider buying yourself a book on ActionScript. Rich's book would be ideal: http://www.amazon.com/gp/product/059652787X Cheers, Ian On Thu, Jan 29, 2009 at 2:13 PM, K-Dawg kdaw...@gmail.com wrote: What's the error? No image appearing? (You haven't used addChild() anywhere.) Well, what I have my main class, PondoShow that extends Sprite. In here I instantiate a Slide object, passing in a bunch of parameters: slides = new Array(4); slides[0] = new Slide(This is a test, this is only a test, img/food_array.jpg, Click here to find out more, more.html, 100, 100, 50, 50, 200, 200); slides[1] = new Slide(This is a test, this is only a test, img/food_array2.jpg, Click here to find out more, more.html, 100, 100, 50, 50, 200, 200); Inside the slide object constructor I instantiate the variables and then, still inside the constructor of the Slide object: this.imagePath = new URLRequest(this.imagePathString); loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.INIT, imageLoaded); loader.load(this.imagePath); } private function imageLoaded(ev:Event):void { trace(inside imageLoaded function); imgload = true; } My PondoShow class does this: while(true) { if (slides[slideCounter].imgload) { addChild(slides[slideCounter].loader.content); break; } } but in the loop, the if statement is never true, and the imageLoaded function never gets called in the Slide class and eventually the loop times out or I kill it. imageLoaded() never getting called? (Probably a red herring, but you really should add the listener _before_ you call load()). Good idea. Certainly more readable at the very least. Unfortunately changing this did not solve my issue though. Give us some more info, then we might be able to help. Ian Thanks for any help. Kevin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Missing Flashcoder archives?
Hey, List folks! So in the interest of Not trying to repost too many questions that have already been asked (like, for example, probably this one) I've been trying to search the Flash Coders List archives. However, going to the archives page over at figleaf.com ( http://chattyfig.figleaf.com/mailman/private/flashcoders/) brings me to a page where nothing has been added since December 2007. Is there a new location where our mail is being stored, or is the archive page just not working? --T ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Missing Flashcoder archives?
Is there a new location where our mail is being stored, or is the archive page just not working? It's not working. It's on my (unfortunately extremely long) to-do list. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Missing Flashcoder archives?
try here http://www.mail-archive.com/flashcoders@chattyfig.figleaf.com/maillist.html On Thu, Jan 29, 2009 at 12:00 PM, Dave Watts dwa...@figleaf.com wrote: Is there a new location where our mail is being stored, or is the archive page just not working? It's not working. It's on my (unfortunately extremely long) to-do list. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- --Joel Stransky stranskydesign.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Missing Flashcoder archives?
Try using the mail-archive site: http://www.mail-archive.com/flashcoders@chattyfig.figleaf.com/ - Original Message - From: Todd Kerpelman t...@kerp.net To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Thursday, January 29, 2009 5:56 PM Subject: [Flashcoders] Missing Flashcoder archives? Hey, List folks! So in the interest of Not trying to repost too many questions that have already been asked (like, for example, probably this one) I've been trying to search the Flash Coders List archives. However, going to the archives page over at figleaf.com ( http://chattyfig.figleaf.com/mailman/private/flashcoders/) brings me to a page where nothing has been added since December 2007. Is there a new location where our mail is being stored, or is the archive page just not working? --T ___ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Missing Flashcoder archives?
Don't worry, I'll repost my flash mailbox back to the list.. ;-) - Original Message - From: Dave Watts dwa...@figleaf.com To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Thursday, January 29, 2009 5:00 PM Subject: Re: [Flashcoders] Missing Flashcoder archives? Is there a new location where our mail is being stored, or is the archive page just not working? It's not working. It's on my (unfortunately extremely long) to-do list. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Missing Flashcoder archives?
If you remove all the which platform, which editor discussions that should halve the mailbox size, Also, stripping the out of office replies and job posts will probably thin another 10% :) Paul Andrews wrote: Don't worry, I'll repost my flash mailbox back to the list.. ;-) - Original Message - From: Dave Watts dwa...@figleaf.com To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Thursday, January 29, 2009 5:00 PM Subject: Re: [Flashcoders] Missing Flashcoder archives? Is there a new location where our mail is being stored, or is the archive page just not working? It's not working. It's on my (unfortunately extremely long) to-do list. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Missing Flashcoder archives?
Cool. Thanks, all! Now I can finally add all of those Plaxo contacts and find out who to contact at masterkitchen.de when Johannes is not available to answer my mail. :) --T On Thu, Jan 29, 2009 at 9:28 AM, Muzak p.ginnebe...@telenet.be wrote: Try using the mail-archive site: http://www.mail-archive.com/flashcoders@chattyfig.figleaf.com/ - Original Message - From: Todd Kerpelman t...@kerp.net To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Thursday, January 29, 2009 5:56 PM Subject: [Flashcoders] Missing Flashcoder archives? Hey, List folks! So in the interest of Not trying to repost too many questions that have already been asked (like, for example, probably this one) I've been trying to search the Flash Coders List archives. However, going to the archives page over at figleaf.com ( http://chattyfig.figleaf.com/mailman/private/flashcoders/) brings me to a page where nothing has been added since December 2007. Is there a new location where our mail is being stored, or is the archive page just not working? --T ___ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders