Flash Camouflage Framework

I am happy to introduce my new Framework called Flash Camouflage. I have just posted a stable build of it on google code and will be continuing to add and refine it over the next few months. Here is a little background into what the framework can do:

Flash Camo (for short) is a display layer framework that allows AS 3 applications to be easily skinned from pngs, jpg, or gifs. Camo also supports CSS styles, a custom BoxModel, and layouts defined by XML. Camo aims to be a foundation for building themed/skinned display layers for your application. You supply the logic that controls it. Camo also allows live streaming of application’s skins so you only display and load what you need when you need it. This allows you to dramatically cut down on the file size of your Flash App without sacrificing detail or design.

So what does this all mean? Here is what the basic core Camo Framework will give you:

  • Custom CSS Parser. Yes thats right, you can now created complex CSS markup for all CamoDisplay Objects and TextFields. Camo’s powerful CSS parser converts CSS selectors into Objects so that CamoDisplays can take the values and render them correctly. The parser also supports CSS cascading and inheritance so you can link multiple selectors together to create base styles for Classes and then specific customization for each id.
  • A true BoxModel Display exits in all CamoDisplay objects. This allows you to have true Margin, Padding, Background Color, Tiled / 9 Sliced Background Images, and Borders (coming soon). All of this is styled from the CSS parser.
  • One centralized Asset Library that allow you to import a “tear sheet” of images to skin your display layer. Simply supply the ID, x, y, width and height of the asset from the sheet and the FrameWork will cut out a Bitmap copy of the asset. This is very powerful, you can condense all of your external image calls into one image and have the framework cut it up for you on the fly. This is the main feature of the framework allowing for fully skinnable applications.
  • XML Driven Components allow you to use xml to describe your components and layouts. Mix and match any Camo Class or even add your own (loaded at runtime) to create complex component layouts that can be created on the fly unlike Flex’s mxml. Camo Components are simple to define and are fully integrated into the Asset library so every component can be skinned on the fly.
  • Components (visible classes) sit in a simple package naming convention to improve organization and allow the framework to know where everything is without needing full package names in the XLM. Simply follow the naming convention to take advantage of the easy lookup system inside of Camo. Classes are singular, packages are plural, and the last camel case word in the class name tells the framework what package it is sitting in. BaseButton sits in camo.views.components.buttons, its that simple!
  • Lite weight framework that is only 60k right now (I estimate it to be around 90k when complete) and you can compress it even more by only importing the classes you need. You can even compile the framework into a separate SWF, load it at run time, and take advantage of the browser’s caching to keep your site’s load time down. Build multiple sites that rely on the same external framework swf for added optimization.
  • Completely flexible framework. This is an open framework, not only is it open source but you can integrate as much or as little of it into your projects as you see fit. I designed this, loosely around the MVC design pattern, but I don’t lock you into how you have to build your own application. Simply call the CamoLibrary whenever you need a CSS Style, Layout, Component, or Asset and integrate it into your app as you would any other Class or Linked Library Asset.

Sounds good right? Well make sure you get the SVN Checkout or the SWC, the AS Docs, and check out the Hello World sample project to see how it works.

Like all things Alpha this is still a work in progress. I have been hand crafting this framework from years of exparements with Design Patterns and custom build frameworks. Because this takes time to perfect I look to you, my readers and soon to be testers, to let me know what you think, where there are bugs and ways to improve it. Please use Google Code’s excellent issue list to let me know what you find.

  • Great idea Jesse! Looks fantastic, I can't wait to have a play with it. I can already think of several projects where this would have been a great help. Thanks for the sterling work and for sharing.
  • This is a great blog!
  • Thanks for the feedback. I am working on a few major updates to make the framework a little more stable as well as updating the Hello World project. I should have that up in the next few days. Sorry for the inconvenience. Finally, I am starting to write tutorials on each of the major classes in the framework so people can understand how they work and how to use them inside and outside of the framework. I realize this framework is only as good as its documentation so I will do my best to get that up as soon as possible. Feel free to email me with any other questions you may have...
  • Hi Jesse,

    Thanks for making a beautiful resource available to everyone. I dig your work.

    little query - I downloaded your little Hello World sample project to check it out. I made a little flash project using the HelloWorldApp.as as the document class but it will not compile. I get this error;

    Layout.as, line 221

    1119: Access of possibly undefined property length through a reference with static type Number.

    Not sure how to go about fixing it - any suggestions?


    P.S. I also had to download the ScaleBitmap class from bytearray.org
  • Jeff Foster
    cool.
blog comments powered by Disqus