Moving forward and reverse on a sequence
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];
}
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];
}
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 #