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; ]]-->
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
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
[...] 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