Bumpslide App Template

I’ve recently updated my application template located in the examples section of my Bumpslide Library. I’ve taken this a step further by packaging this as an archive that is ready to use as a starting point for new AS3 Flash applications.

Download: Bumpslide AS3 App Template

This project template includes everything you need to get started with my library as an application framework. This is a working application with FLA file and sample HTML including support for deep linking with SWFAdress. The source code for the application is in the ‘app’ package. Reading the documentation in the source files is the best way to learn.

How MVC do you want it?

I have found that for small applications, the command pattern is often overkill. Since this is a starting point for small flash apps and micro-sites, this application template does not use commands. All state changes are affected by simply changing the data on the model, and logic inside the model setters coupled with bumpslide binding magic results in a rather agile approach to flash application development that is as MVC as you want it to be. That is, if you want to separate your views from the model, feel free to dispatch events, and catch them in a top level view or mediator. If you want to encapsulate all model changes in commands, feel free. There is a cairngorm-like FrontController included here if you want it. Just replace the Controller with a class that sub-classes FrontController, and use the CommandEventDispatcher to dispatch the command events.

If you find this useful, or if you have any issues, please let me know. This is the code I use every day, and it’s constantly evolving. I believe this release is stable, but it is quite fresh.

6 Responses to “Bumpslide App Template”

  1. Tyler Craft Says:

    Thanks for putting this out. Your bindable model has made my actionScript life a much happier one!

  2. Gil Says:

    Great template. Thanks for sharing!
    As far as the ui package goes, I was wondering if you would consider removing the tweening code from at least BaseClip, if not all of the ui. This would make the components lighter and not penalize us for using a different tweener….

    There could be external static hooks instead, like how you initialized DisplayShortcuts?

  3. david Says:

    @Gil, the tweener stuff is only being used in the fadeIn/fadeOut functions which are in turn used by the hide/show methods of BaseClip. This class has become a place for shortcut methods like that. I agree that in this case, it’s not worth the dependency. Thanks for calling me out on that. For now, that’s pretty easy to comment out, but I do feel your pain, so I’ll move those functions to a static utility elsewhere. I’m not using Tweener anywhere else. FTween, however, is a core piece used in my grid and scroll panels as well as the drag and zoom behaviors. This will still be required.

  4. Ben McMaster Says:

    David! This is awesome. It is cool to see more examples of how you use the code.

    I have a question, I thought I would post here so that more people could see… I was looking into grabbing variables from the URL. I came across this:

    http://evolve.reintroducing.com/2008/07/03/as3/as3-querystring/

    I have been poking around the new App Template and I would like to stay true to the Bumpslide way… What do you use to get the vars from the URL?

  5. david Says:

    @Ben - Yes, you can grab url params via external interface, but this class needs some checks in place for when external interface is not available.

    I use SWFObject’s utility functions (swfobject.getQueryParamValue) or PHP to pass query string values to the swf via flashvars (loaderInfo.parameters). In my applications, flashvars are parsed by the Config class, an instance of which is stored in the Model. Then, all run-time settings are in model.config which is created either in a startup command or by the controller directly before the main view is instantiated. The Config class has default settings in place that are applied whenever running the swf in a context where flashvars are not available (ex: ‘Test Movie’). Overall, I think this is a more elegant and flexible approach than relying on ExternalInterface, but I’m sure there are cases where that could be necessary. Thanks for the link.

  6. david Says:

    Followup on tweening - I need some basic show/hide tweening in my library somewhere, as it is used by components such as the lightbox, combobox, and others. I really like being able to set the time and delay on those tweens, and this is one case where FTween isn’t the best choice. Tweener seemed like a good fit at one time, but I’d be happy to bundle TweenLite here instead. What do you all think I should do here?

    One option is to put a bare visible=true/false operation in the baseclip show/hide methods, and override them in AppComponent to use a specific tweening lib. Again, I like having the delay and onComplete options in those functions, and I use them daily.

    Other options include moving those operations to a static utility or making some new shortcut methods on FTween. Then, I could just remove any tweened showing and hiding from my components.