Código :
import mx.transitions.Tween;
import mx.transitions.easing.*;
//
btn._xscale = 10;
btn._yscale = 75;
//
btn.onEnterFrame = function() {
//
this._x = (Stage.width - this._width)/2;
};
//
btn.onRollOver = function() {
//
var sizeX:Tween = new Tween(this, "_xscale", Strong.easeOut, this._xscale, 100, 0.3, true);
var sizeY:Tween = new Tween(this, "_yscale", Strong.easeOut, this._yscale, 100, 0.3, true);
//
var alpha:Tween = new Tween(this, "_alpha", Regular.easeOut, this._alpha, 75, 0.3, true);
};
btn.onRollOut = function() {
//
var sizeX:Tween = new Tween(this, "_xscale", Strong.easeOut, this._xscale, 10, 1, true);
var sizeY:Tween = new Tween(this, "_yscale", Strong.easeOut, this._yscale, 75, 1, true);
//
var alpha:Tween = new Tween(this, "_alpha", Regular.easeOut, this._alpha, 100, 1, true);
};
en este caso se posiciona segun el Stage, pero si lo tienes dentro de otro MC, cambia estas linea:
Código :
btn.onEnterFrame = function() {
//
this._x = (Stage.width - this._width)/2;
};por estas
Código :
btn.onEnterFrame = function() {
//
this._x = (instanciaClipContenedor._width - this._width) /2;
};