Currently Reading

Image of Derivatives Demystified: A Step-by-Step Guide to Forwards, Futures, Swaps and Options (The Wiley Finance Series)

Image of Working Effectively with Legacy Code (Robert C Martin)

Image of Coders at Work: Reflections on the Craft of Programming

Image of Succeeding with Agile: Software Development Using Scrum (Addison-Wesley Signature)

Image of iPhone UK: The Missing Manual

Image of My Shit Life So Far

Recently Read

Image of iPhone Advanced Projects (Books for Professionals by Professionals)

Image of ActionScript 3.0 Design Patterns: Object Oriented Programming Techniques (Adobe Developer Library)

Image of Advanced Actionscript 3 with Design Patterns

Image of Test Driven: TDD and Acceptance TDD for Java Developers

Image of Refactoring: Improving the Design of Existing Code (Object Technology Series)

Image of Beginning iPhone 3 Development: Exploring the iPhone SDK

Image of Clean Code: A Handbook of Agile Software Craftsmanship (Robert C. Martin)

Image of The Secrets of Consulting: A Guide to Giving and Getting Advice Successfully

Image of UML 2 for Dummies

Image of Test Driven Development (The Addison-Wesley Signature Series)


June 24, 2008

Application Version Control in AS3

Filed under: ActionScript, Bug Fixes, Flex, Japanese — Anthony @ 2:23 am

I thought that I would just write a quick note on how I know which version of an application I am looking at when it has been published to the web. It's all well and good saying its revision 87 from svn but how do you know? Well a simple way is to add it to the Flashplayers custom context menu. Right click to see the custom menu and to view the source

This comprises of making just two files one of which is a singleton class that can be used for every project you want to add version control to and the second is a VersionControl.properties file which you update before you publish a new version of your application lets take a look at that file first

#Each item takes the same params as the ContextMenuItem class
#and is seperated by and & ampersand
#caption:String = caption Value : String,
#separatorBefore:Boolean = false,
#enabled:Boolean = true,
#visible:Boolean = true
#In addition each item supports a url variable just add
#&YOUR URL GOES HERE;
Version=Version 0.1&false&false&true;
url=Developer:A McCormick&false&true&true&www.goeshere.com
viewSource=ViewSource&false&true&true&www.goeshere.com

The Second class controls what these properties do i know its a long class but its fully commented. ( right click the grey square above and choose view source to see the VersionController class ).
Basically it loops through the VersionControl.properties file and builds context menu items based on the values, adding the ability to include links as well.
And finally all you have to do is call getInstance( this ); in your main application file.

<!--[CDATA[
 
			import VersionControl.VersionController;
 
		]]-->

3 Comments »

  1. Excellent ! Thank you.
    What happens if the “default” context menu is disabled or already fully customized ?

    Comment by Arnaud — July 2, 2008 @ 10:34 am

  2. Well you can’t fully disable the context menu in Flash without using some third party scripting, as for fully customized context menu’s i’m not sure..

    Comment by Anthony — July 7, 2008 @ 1:59 pm

  3. [...] Application Version Control in AS3 Posted Julho 29, 2008 Filed under: Examples | http://www.betadesigns.co.uk/Blog/2008/06/24/application-version-control-in-as3/ [...]

    Pingback by Application Version Control in AS3 « Rflex’s Weblog — July 29, 2008 @ 2:50 pm

RSS feed for comments on this post. | TrackBack URI

Leave a comment

XHTML ( You can use these tags): <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .