Here is a tip on traversing back and forward on a sequence if you know the current object.

public function next(locations:String[],location:String ):String {            
                var index = Sequences.indexOf(locations,location);
                if ( index >= (sizeof locations - 1)){
                    index = 0;
                }else index ++;
                return locations[index];  
}

public function prev(locations:String[],location:String ):String {            
                var index = Sequences.indexOf(locations,location);
                if ( index <= 0){
                    index = sizeof locations - 1;
                }else index --;
                return locations[index];  
}

Comments:

Have a iPhone and want to diversify your ringtone? This amazing http://www.mp3tom4rconverter.com can definitely help you out.

Posted by WMV Converter OS X on May 07, 2009 at 08:19 AM IST #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by Raghu Nair