Posts Tagged AS3

Open source AS3 frameworks to test run

With so many handy AS3 frameworks out there I often get excited about each new offering, but in the end I’m overwhelmed with the options and so rarely give any a test run.
 
Frameworks I use

Here’s a list of frameworks that I do rely on heavily and couldn’t live without (This is mostly for Flash website development).

PureMVC Brilliant MVC framework for AS3 (and a plethora of other platforms). This was my first foray into MVC and was hard going to get my head around, but now, I don’t look back!

swfAddress Integral for current Flash website development. Adds deep linking and browser history to your websites. Another good thing about swfAddress is that it forces you to use elements of good practice when developing your navigation code, it’s asymmetrical and requires a central navigation function.

Tweener One of the many Tween engines out there. I like Tweener because it’s simple to use and has shortcuts for really handy things (like colour effects and sound control). Most tween engines these days all do pretty much the same thing – either way they are vital tools for any actionscript animation.

And of course I have my own Tool and UI packages that I leverage on projects, being able to streamline and make more robust with each new job.
 
Frameworks to test run

But now to the point of this post. My new resolution is to tackle the mountain of frameworks out there, one at a time. I’ll do a quick “hello world” demo with each to get some hands on experience and see any potential for practical use. So, I’ll add to this list, but to start off with I’ll be looking at:

Flash Camoflage I don’t know too much about camoflage, but my general understanding is that it’s a Flash chrome and skinning framework

Tags: , , , , , ,

No Comments

Changing the behaviour of a class without recompiling.

This is a feature in AS3 that I hadn’t come accross before. If you ever load swf files into one another you might not know it, but you’ll be dealing with application domains. I’ve loaded in SWF’s before, but never had to pay any specific attention to the applicationDomain.

Basically they allow you to specify where the class definitions for an SWF are sourced from. By default if two SWF files use a class with the same name, then only the definition found in the parent SWF will be used. If you want the child SWF to use it’s own version of that class, then you need to give it it’s own application domain.

From the Adobe docs:

1
2
3
4
        request = new URLRequest("http://www.url.com/myflashfile.swf");
        var context:LoaderContext = new LoaderContext();
        context.applicationDomain= new applicationDomain()
        loader.load(request,context);

The current project I’m working on loads in a variety of SWFs that extend a common base class. It ended up that I needed to make a change to the base class, so at first I thought I was going to have to go and recompile all of the external swf files in order to incorporate the changes I’d made. But actually, this wasn’t the case due to the default behaviour of the applicationDomain. It turned out that as long as that base class was used in the parent swf, then all the external swfs that were loaded in would use the defintion found in it and not their own. Way to go! It meant that I could tweak and make changes to those external swfs, without ever open or recompile them. It’s turned out to be really useful, and painless!

Tags: , , , ,

No Comments

Getting started with PureMVC – Part 1

I’ve been meaning to get stuck in to MVC patterns with AS3 for a while now and had been hearing lots of good things about PureMVC. Got a little project the other day that I think is perfect to use as an introduction. I’ll be writing about the process as I go, which will definately be a journey of discovery. I’m sure I’ll take some wrong turns along the way, but I ‘m hoping at the end of it I’ll have left an informative trail for anyone else wanting to try PureMVC.

So, for the project:
The basic layout uses an arcordian style approach to display 3 different pieces of content:
panel_layout
The content will load via XML and use a slide transition to switch from tab to tab.

Understanding MVC concepts
Having never worked with an MVC approach I found it a bit daunting diving straight into PureMVC at first as they’ve extended the paradigm to include a Facade as well as Proxies (to work with the Model), Mediators (to work with the View) and Commands (to work with the Controller). there’s a lot of jargon to learn and I admit it took me a couple of days to get my head around it. Luckily I did all the heavy lifting as far as this is concerned a while back, so with a quick refresher on the main actors, their assistants and their tasks I feel like I’ve got a pretty solid understanding of the concepts involved. I’m sure I’ll be eating my words soon enough though.

Getting Started
So I’m now ready to start building my application. I’m actually not exactly sure where to start. I’ll be using Flash CS4, so I’ve set up a document class called Main.as which doesn’t do anything yet besides send through a stage reference to the custom ApplicationFacade class. I’ve also created my generic Tab and Content Movieclips and exported them for use with actionscript in anticipation of adding them to the stage when the time comes.

First Steps
So I guess the first step is to load the XML data sheet that will provide the content data for the application. This will involve an asynchronous process so I’m guessing I’ll need a notification to tell the application when the file is loaded. The XML is part of the Model of the application, so I guess I’ll be creating a Proxie to store the data once it’s loaded. I’m currently looking at the Start Up As Ordered demo on the PureMVC website to work out how to do this. They use an extension call the StartupMonitor to to all the initial loading so I’ll be trying to understand that. It seems like it’s a bit more involved than my needs for this project, but it will be worthwhile understanding it for future porjects.

If anyone is reading this with some PureMVC experience please feel free to make comments and point me in the right direction if I’m going off course, it’s all a learning experience so I’ll be glad for the input.

Tags: , , ,

No Comments