http://www.sargentoweb.com/as2/?doc=45
Aciones____________
Código ActionScript :
ttlSecciones = 5;
function fNavegar( activo ){
for( i = 1; i <= _root.ttlSecciones; i++ ){
ref = _root['mc' + i ];
if( ref.identificador <= activo ){
ref.onEnterFrame = function(){
// Incrementamos una fracción de la diferencia
this._y += ( this.origenY - this._y ) / 5;
// Evaluamos si ha llegado a su destino
if( Math.abs( this._y - this.origenY ) < 0.5 ){
// Aseguramos la posición
this._y = this.origenY;
// Eliminamos la función
delete this.onEnterFrame;
}
}
}
else {
ref.onEnterFrame = function(){
// Incrementamos una fracción de la diferencia
this._y += ( this.destinoY - this._y ) / 5;
// Evaluamos si ha llegado a su destino
if( Math.abs( this._y - this.destinoY ) < 0.5 ){
// Aseguramos la posición
this._y = this.destinoY;
// Eliminamos la función
delete this.onEnterFrame;
}
}
}
}
}Botones___________
Código ActionScript :
on( release ){
_root.fNavegar( identificador );
} 