Thursday, March 10, 2011

Create a Git Branch at a commit, Cherry-pick a commit

Git is very powerful and flexible. I simple love GIT

To create a new branch at a specific commit, is very simple

step1 : find out the Commit Point

$git log –oneline –decorate –graph

* 5da8d22 (HEAD, origin/master, origin/HEAD, master) adding the amazonfps versio
* 249e8f2 Remote the views and controllers files from plugin, first official rel
* 1859484 add some comments
* 51510a3 Moved the .git directory to inside from outside The plugin is now work
* ef5f694 initial checkin for amazonfps plugin
* 316cc21 removed mail.jar and mail jndi for morp support
* a7c2694 changed grailsplugin to comment jndimailsession, which was causing pro
* 9e9aab2 add the morph deploy jars
* b5c1b31 initial checkin
* 0ad0cd6 first commit

Step2 : BranchOut

git branch devbranch ef5f694

Will create a gitbranch at that commit point

Wednesday, March 9, 2011

Integrate Captivate Files With Adobe Flex

Adobe Flex came to rescue when we hit the wall with Captivate, need some customizations in the Captivate UI.  Had to struggle to find a good documentation on access Captivate Variables and Events in Adobe Flex

Following are the Steps

Step1 : Setup

Download and Copy the classes Actionscript classes to your and helper classes from

Create package (com.widgetfactory) and copy the events and helpers to your project

Step 2: Access Captivate Variables and Events

Create a Flex Project and add Image comp for Captivate File,Captivate  Access Events and variables

   1: <s:Application>
   2: <fx:Script>
   3:     <![CDATA[
   4:         import;
   5:         import;
   6:         import com.widgetfactory.helpers.CaptivateEventsToWidgetEvents;
   8:         private function loadCaptivateFile( url:String):void {
   9:               if( !contentLoader.hasEventListener( Event.COMPLETE ) ) {
  10:                         contentLoader.addEventListener( Event.COMPLETE, handleCaptivateLoadComplete );
  11:                }
  12:               contentLoader.load( url ); //url points to the swf file
  13:         }
  15:      private function handleCaptivateLoadComplete( event:Event = null ):void {
  16:             var captivateMovie:MovieClip = MovieClip(contentLoader.content);            
  17:             CaptivateEventsToWidgetEvents.registerEventsWithWidgetEvent( this, captivateMovie);
  18: //Access captivate events
  19:             if( !captivateMovie.hasEventListener( WidgetEvent.ENTER_MOVIE ) ) {
  20:                 captivateMovie.addEventListener( WidgetEvent.ENTER_MOVIE, movieStartedEvent, false, 0, true );
  21:             }
  22:      }
  24:     private function movieStartedEvent(event:WidgetEvent):void{
  25:           var captivateMovie:MovieClip = MovieClip(contentLoader.content);
  26:           captivateMovie.cpCmndMute = 1            //acccess cpativate variables
  27:     }
  29: <s:Application>


Captivate variables take a little time 10-20ms to take into effect, so if you set it and right away try to access it, you will still see the old value.

Ideally, I feel, if the project is getting too complex, it better to your Flex directly and create a database centric application instead of Using Captivate and doing workarounds. But again this is case by case.

Happy Flexing!!