Gracias a la comunidad estoy haciendo una tira de imagenes basandome en un codigo que publicaron aquí, todo esta excelente y apesar de ser un completo novato creo que entiendo el codigo, pero tengo un problema.
Parece ser que solo funciona con el MC "clip1" repetidamente... lo que intento hacer es que llame a "clip2", "clip3" y asi sucesivamente... como debo declararlo en el ActionScript?
Este es el codigo:
escribió:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var entrfrm:Function = function( Void ):Void
{
var sig:MovieClip = this._parent["clip" + (this.index + 1)];
var ant:MovieClip = this._parent["clip" + (this.index - 1)];
if( sig == undefined )
{
var lan:Number = ant._x + ant._width / 2;
this._x = lan + this._width / 2;
}
else if( ant == undefined )
{
var lsg:Number = sig._x - sig._width / 2;
this._x = lsg - this._width / 2;
}
else
{
var lsg:Number = sig._x - sig._width / 2;
var lan:Number = ant._x + ant._width / 2;
this._x = lan + (lsg - lan) / 2;
}
};
var rollovr:Function = function( Void ):Void
{
this.twx.stop();
this.twy.stop();
this.twx = new Tween(this, "_xscale", Regular.easeOut, this._xscale, 100, 1, true);
this.twy = new Tween(this, "_yscale", Regular.easeOut, this._yscale, 100, 1, true);
};
var rollout:Function = function( Void ):Void
{
this.twx.stop();
this.twy.stop();
this.twx = new Tween(this, "_xscale", Regular.easeOut, this._xscale, 75, 1, true);
this.twy = new Tween(this, "_yscale", Regular.easeOut, this._yscale, 75, 1, true);
};
this.clip1.x = this.clip1._x;
for( var i:Number = 1; i <= 4; i++ )
{
this["clip" + i].index = i;
this["clip" + i].onEnterFrame = entrfrm;
this["clip" + i].onRollOver = rollovr;
this["clip" + i].onRollOut = rollout;
}
gracias