Archive for the 'ActionScript' Category

Card Sorting Method Presentation

Sunday, February 22nd, 2009

As part of the assignment in the Technical Communication classes that I am taking to get ( eventually ) Master degree in UX, each of us ( in a group pair ) must read a chapter from the UX book ( Understanding Your User ) about method in UX study and presenting it to the class.

My group has the chance to presenting Card Sorting Method. Here is the slide that we use in the card sorting presentation. We want to make a presentation that’s not too long for the class, doesn’t have too many lengthy sentence / words and want to keep it interesting. So we come up with presentation with lots of sketches and diagrams to keep it light and interesting. Enjoy … and yes the sketches was made from scratch by me 🙂

Enso Penthouse Kiosk @ Discovery Center

Monday, February 9th, 2009

Real Estate group ask me to create a kiosk for Discovery Center to showcasing their Enso Living Penthouses. The design was taken from the original website with special tweaking to conform with the wide screen format ( kiosk ).

Application information :

  • Architecture : PureMVC framework
  • XML based configuration ( for ease of updating unit availability and updating any text in the application )
  • All images and swfs are external assets that downloaded dynamically
  • Flex 3, deMonster Debugger, Tweener, FDT

Here is the video to give an overview of what the project looks like.



Or you can visit South Lake Union Discovery Center ( http://www.discoverslu.com/ ) for more information.

Procrastinator Class

Saturday, March 24th, 2007

Today I am debugging a video player project at work. One of the solution that I use in the debugging process is adding a delay to a function call. In the project I am using onEnterFrame function to create a counter delay and then execute the function at the end of the counter limit.
I think it will be more useful if I can create a static class function that can be reusable easier for other project.

I did some Google search about how other people doing delay in action script and come across to one sample here Delaying Actions – ActionScript.org but his method is for flash 4 and not enclosed in a portable / reusable class. So I created one static class like this:

/**
 *     utility to set a delay of action
 *
 * @author         OQ Ludiro
 * @date            Mar 24, 2007
 *
 * @class         Procastinator
 */

 
class com.ludiro.Procastinator
{
    private var __target_object : Object;
    private var __target_function : Function;
    private var __target_parameters : Array;
    private var __interval_id : Number;
    private var __done_flag : Boolean;
   
   
    /**
     * Procrastinator Constructor
     *
     * @param delay_timer : Number delay timer in milli seconds
     * @param targetScope : Object
     * @param targetFunction : Function
     */
    public function Procrastinator( delay_timer : Number , target_scope : Object, target_function : Function )
    {
        __done_flag = false;
        __target_object = target_scope;
        __target_function = target_function;
       
        clearInterval( __interval_id );
        __target_parameters = new Array();
        for( var i : Number = 3; i < arguments.length; i++ )
        {
            __target_parameters[ i - 3 ] = arguments[ i ];
        }

        // delay timer is in milliseconds
        __interval_id = setInterval( this, "runOnce", delay_timer );
       
    }
   
    /**
     * @function runOnce
     * @description run the function only once after certain delay time
     * @param   
     * @return    Void
     */
    private function runOnce(  ) : Void
    {
        trace( "\tProcrastinator:*runOnce invoked" );
        if( __done_flag )
        {
            var aActualParameters : Array = arguments.concat( __target_parameters );                
            __target_function.apply( __target_object, aActualParameters );
            clearInterval( __interval_id );                     
        }
        else
        {
            __done_flag = true;
        }       
    }

	/**
	 * @function cancel
	 * @description cancel the timer and clear the object
	 * @param	
	 * @return	Void
	 */
	private function cancle(  ) : Void 
	{
		trace( "\tProcrastinator:*cancle invoked" );
		clearInterval( __interval_id );
		delete __target_parameters;
		delete __target_function;
		delete __target_object;
		
		delete this;
	}

}// end of Class

Usage :

var delay_value : Number = 3000; // delay timer in milliseconds
var target_class : Object = MainClass; // this is the class where function resides
var target_function : Function = MainClass.functionCall;

var procast : Procrastinator = new Procastinator( delay_value, target_class, target_function );

Hope this helps in DELAYING / Procrastinating your Action 🙂

String Util find and replace

Saturday, January 20th, 2007

Recently, I need a tools to find and replace a string for my flash lite program.

I come up with a quick and easy method to do the swap using string.split and array.join.

Unfortunately this method will not work on Action script 1 / Flash 4 version because it doesn’t support string split with a substring as the delimiter

class StringUtil
{
/**
* @function findReplace
* @description find substring and replace the
* substring with the  new string from the main string
* @param string_source : String
* @param find_string : String
* @param replace_string : String
* @return    String
*/
      public function findReplace( string_source : String, find_string : String, replace_string : String ) : String
      {
            trace( "StringUtils:findReplace invoked" );
            var temp_array : Array = string_source.split( find_string );
            var result_string : String = temp_array.join( replace_string );
            return result_string;
      }
}

can come handy in many other code situation.