Foros del Web » Creando para Internet » Flash y Actionscript »

Accion a boton en actionscript

Estas en el tema de Accion a boton en actionscript en el foro de Flash y Actionscript en Foros del Web. Que tal tengo un dock en flash(galeria interactiva tipo carrusel) como el de este sitio trump.com y quiero darle una accion "goto and stop"a uno ...
  #1 (permalink)  
Antiguo 22/05/2009, 14:01
 
Fecha de Ingreso: octubre-2007
Mensajes: 66
Antigüedad: 16 años, 7 meses
Puntos: 0
Pregunta Accion a boton en actionscript

Que tal tengo un dock en flash(galeria interactiva tipo carrusel) como el de este sitio trump.com y quiero darle una accion "goto and stop"a uno de esos botones para queme envie a cierta escena y fotograma de mi flash interno,este es mi codigo:

function checkOffset(coffset)
{
if (coffset < -mouseRadiusX)
{
coffset = -mouseRadiusX;
}
else if (coffset > mouseRadiusX)
{
coffset = mouseRadiusX;
} // end else if
return (coffset);
} // End of the function
function checkOffset1(coffset1)
{
if (coffset1 < -(mouseRadiusX - 60))
{
coffset1 = -(mouseRadiusX - 60);
}
else if (coffset1 > mouseRadiusX - 60)
{
coffset1 = mouseRadiusX - 60;
} // end else if
return (coffset1);
} // End of the function
function setScale(soffset)
{
return (80 * (scale - (scale - 1) * (Math.abs(soffset) / mouseRadiusX)));
} // End of the function
var spacerX = -12;
var speed = 3.600000E+000;
var btnWidth = 100;
var posX = 50;
var posY = 70;
var scale = 1.300000E+000;
var mouseRadiusX = 150;
var Yscale = 1;
var btnName = new Array({text: "MARINA TOWERS", link: "#"}, {text: "PUERTO SALINA", link: "#"}, {text: "CABO RIVERA", link: "#"}, {text: "ECKHERT PALACE", link: "#"}, {text: "VACATION WORLD", link: "#"});
mButton._visible = 0;
var _l1 = 0;
while (_l1 < btnName.length)
{
this.attachMovie("btn", "btn" + _l1, _l1 + 10, {_x: _l1 * (spacerX + btnWidth) + posX, _y: posY + btnWidth});
this["btn" + _l1].btnMCz.gotoAndStop(_l1 + 1);
this["btn" + _l1].link = btnName[_l1].link;
trace (btnName[_l1].link);
this["btn" + _l1].bnm.text = btnName[_l1].text;
var textY;
if (this["btn" + _l1].bnm.textHeight <= 2.230000E+001)
{
textY = -126;
}
else
{
textY = -142;
} // end else if
this["btn" + _l1].bnm._y = textY;
this["btn" + _l1].onRollOver = function ()
{
num = Number(this._name.substr(3, 2));
Yscale = 2;
};
this["btn" + _l1].onRollOut = function ()
{
Yscale = 1;
};
this["btn" + _l1].onRelease = function ()
{
getURL(this.link, "");
};
++_l1;
} // end while
MovieClip.prototype.scaleTo = function (scl, x)
{
this.scl = scl;
this.x = x;
this.onEnterFrame = function ()
{
this._yscale = this._xscale = this._xscale + (this.scl - this._xscale) / speed;
this.swapDepths(Math.round(this._xscale) + 100);
this._x = this._x + (this.x - this._x) / speed;
};
};
onEnterFrame = function ()
{
y = this._ymouse;
x = this._xmouse;
for (var _loc2 = 0; _loc2 < btnName.length; ++_loc2)
{
this["btn" + _loc2 + "Offset"] = x - (_loc2 * (spacerX + btnWidth) + posX);
if (y <= posY + btnWidth && x > this.btn0._x - this.btn0._width / 2 && x < this["btn" + (btnName.length - 1)]._x + Yscale * btnWidth / 2 && y > this["btn" + num]._y - Yscale * btnWidth)
{
this["Offset" + _loc2] = checkOffset(this["btn" + _loc2 + "Offset"]);
this["a" + _loc2] = checkOffset1(this["btn" + _loc2 + "Offset"]);
this["btn" + _loc2].scaleTo(setScale(this["Offset" + _loc2]), _loc2 * (spacerX + btnWidth) + posX - this["a" + _loc2] / 1.400000E+000);
continue;
} // end if
this["btn" + _loc2].scaleTo(80, _loc2 * (-12 + btnWidth) + posX);
} // end of for
};



Puedo darles links a urls en las variables de la linea 37 y las acciones al onrelease en la linea 68 pero no he podido darle la accion de Goto and stop a una escena de mi flash, Alguien puede ayudarme????
  #2 (permalink)  
Antiguo 25/05/2009, 09:46
 
Fecha de Ingreso: octubre-2007
Mensajes: 66
Antigüedad: 16 años, 7 meses
Puntos: 0
Respuesta: Accion a boton en actionscript

Creo que no entendieron mi pregunta ymenos mi código, pero si a alguien le interesa pude lograr que me redireccionara a un loadmovienum colocando esta acción en lugar de getURL Saludos!!
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 15:31.