Archive for the flash Category

Uniquely Compile AS2 with JSFL – Avoiding Class/Namespace Collision between swfs

AS2 does not have the concept of an application domain. So if you are loading multiple child SWFs into your AS2 project, any classes that the SWFs share will be cached at their first use. The cached definitions will stand in for any following references to the class. Not always good, and depending on your project, it can cause some pretty serious issues and headaches. Need a way around this AS2 class collision issue? Me too, so I made one.

Continue reading Uniquely Compile AS2 with JSFL – Avoiding Class/Namespace Collision between swfs

Tinkering: Traveling Boxes

I have been reading about GTween, the tweening library from Grant Skinner, and this morning, I decided to check it out. While on his blog, I was reminded of FlashBuilder 4 (formerly FlexBuilder) and decided to grab the Beta off of Adobe Labs. Just to test out the FB4 environment, I started tooling around with some native 3D stuff.

Click on a square to follow it, click on the background to reset the camera back to its original position.

Continue reading Tinkering: Traveling Boxes

Tinkering: 25 lines of branches

If you haven’t heard, Keith Peters has breathed new life into the old 25 lines Actionscript Contest. The site has now just finished is still taking submissions for the 2nd contest (January 2009). I recommend getting involved in this contest, or at least seeing what you can do with 25 lines of code no matter what programming language you use. I re-worked my previous branching experiment and got it to fit in less than 25 lines, and was even able to add some simple 3D rotation stuff. Very cool. Anyway, here is what I submitted:

Continue reading Tinkering: 25 lines of branches

Tinkering: Branches

I have been meaning to try my own branching experiments for a while now. I have been tinkering with some recursive drawing algorithims. Not sure where this will end up, but its been a pretty fun start…

you can click anywhere on the stage to start a fresh drawing…

Event Bubbling in AS2

Yes, we all know the numbers. FlashPlayer 9 is at 97% penetration worldwide. After a year of primarily AS3 development (not starting any new AS2 projects), I find myself working on a project back-porting AS3 into AS2. Ohhhhhh yay, what a joy! I love the screwy event model, the rigid display list, having to fake document classes, not being able to do new MovieClip(), … and the list goes on… Regardless, this is my task, and I will prevail with flying colors (are you with me?) !

One requirement to keeping the code bases similar is to implement event bubbling in AS2. I looked around for a few techniques we could implement into our ‘new’ AS2 code, but had trouble finding an example that could be added cleanly into our project. We needed something that could extend MovieClip, and allow any subclass to bubble events up their respective _parent chain. I definitely found some working bubbling techniques, mainly this one, but decided to re-familiarize myself with AS2 by encapsulating this whole bubbly stuff.

Continue reading Event Bubbling in AS2