Archive for the 'AS3' Category

AS3 for Noobs (Part 4): Garbage collection

Friday, January 4th, 2008

So maybe you’ve heard of this whole garbage collection thing and you’re wondering what it is and why should you care. I’m going to give you a simplified description of what it is and the best practices I’ve found to deal with it. Basically in AS2 when you removed an object like a movieclip or something, you no longer had to worry about it, it was gone. It either was there on stage or it didn’t exist. For instance in my gallery application are a lot of photos get loaded at one time and I had to limit how many displayed at a time because the more that were on stage the slower flash would get. So I would display 100 then when I wanted to display another 100 I would just remove the first 100 and everything would work just fine.

Well now since display objects don’t live and die on the stage, you can remove a clip from the stage but it still exists. It’s just waiting “back stage” in case you need to use it again. This is great for some things but like in my gallery example above it causes a real problem. I can remove the first 100 thumbnails from the stage but they are still there hogging up memory. If you remove an object from stage and you don’t use it again for a long time, the flash player will mark it for removal so that it actually will disappear from memory. This process is called “garbage collection”. The problem is that if any other object references it then it won’t ever be marked for removal because flash still thinks it’s needed. (more…)

AS3 for Noobs (Part 3): The _root problem

Tuesday, September 18th, 2007

When I tried to switch to AS3 and suddenly _root and _global were just gone. And it wasn’t that they just got renamed something else, they were gone and nothing that I could find had replaced them. Needless to say I was extremely confused. Why were they gone? How am I supposed to write applications without them? Obviously other people are getting along without it so what am I missing here? (more…)

AS3 for Noobs (Part 2): Learn the lingo

Wednesday, September 12th, 2007

Another thing that is initially very intimidating about learning a new skill is all the terminology that people throw around and expect you to know. I’m going to break down some of these terms in a way that hopefully everyone can understand so you know what they mean and why you should care. I know these articles seem like they deal mainly with classes and not AS3 but we are building up to it. This is all fundamental stuff you’ll need to understand if you want to get far with AS3 at all so just stick with me on this one. (more…)

AS3 for Noobs (Part 1): A class on classes

Sunday, September 9th, 2007

Alright so I’ve had some time to calm down from my initial AS3 adventures and things are going much better now. Once I finally got over the hump of trying to compare AS3 to AS2 and just thought of it as something completely different (even though it’s not completely) I’ve actually been enjoying the experience. Now that I’ve been working with it for long enough, I can tell you that I’ve joined the OOP fan-club and got a cool t-shirt that says I heart OOP.

NOTE: The point of this article is not really to teach you how to use classes, but more to help you understand what classes are and why you should use them, because to me knowing “why” and “when” was much harder then learning the “how”. If you want to know how to use them check out the help file that came with flash because it gives a lot of good examples. Also I’ll be oversimplifying what classes are and do in this article because at the moment we are just taking some baby steps hence the “AS3 for Noobs” title. (more…)

AS3: Programmer’s Paradise or Designer’s Dungeon

Wednesday, August 15th, 2007

Well I thought it was about time that I use this blog for what I originally created for. I created it to talk about my experiences as a developer so I’m going to share my latest jump I’ve made into the land of actionscript 3. Just as a warning this post doesn’t really have any helpful tips, it’s more just me venting some thoughts about my personal experience with the new actionscript.

First off you must understand that got started in this business as a designer. I’ve always had a passion for design and I only really got into programing as a way to enhance my designs and make them come alive. So I started learning programing in actionscript 1. Now if you ask “real” programmers they will tell you how it was barely a real programing language. It was extremely simple and let you get away with a lot. So “real” programmers didn’t like it but as a designer I loved it. It made me feel smart and say “Hey look at me, I’m a programmer now too!”. (more…)