Imagem preencher MOVIECLIP
Tenho o código abaixo, contudo gostaria que as imagens carregadas preenche a area do MC, tentei usar mc._xscale e yscale, mas teria de informar a ele que a imagem esta menor e mudar esses xscale ou yscale para um valor maior. Obrigado.
new mx.transitions.Tween();
new mx.transitions.easing.None.easeNone();
new mx.transitions.easing.Strong.easeOut();
function proximoTicker()
{
ticker_atual < n_tickers - 1 ? (ticker_atual++) : (ticker_atual = 0);
insereDados(ticker_atual);
clearInterval(ticker_intervalo);
} // End of the function
function anteriorTicker()
{
ticker_atual > 0 ? (ticker_atual--) : (ticker_atual = n_tickers - 1);
insereDados(ticker_atual);
} // End of the function
function vaiParaTicker(numero_ticker)
{
ticker_atual = numero_ticker;
insereDados(ticker_atual);
} // End of the function
function insereDados(ticker_atual)
{
legenda_mc.titulo_txt.text = tickersXML.firstChild.childNodes[ticker_atual].childNodes[0].firstChild.nodeValue;
legenda_mc.texto_txt.text = tickersXML.firstChild.childNodes[ticker_atual].childNodes[2].firstChild.nodeValue;
carregaFoto(tickersXML.firstChild.childNodes[ticker_atual].childNodes[3].firstChild.nodeValue);
area_mc.onRelease = function ()
{
getURL(tickersXML.firstChild.childNodes[ticker_atual].childNodes[4].firstChild.nodeValue, "_self");
};
} // End of the function
function carregaFoto(scr)
{
fotoIn.stop();
var mclFoto = new MovieClipLoader();
mclFoto.loadClip(scr, fotoCima);
this.onLoadInit = function ()
{
clearInterval(ticker_intervalo);
ticker_intervalo = setInterval(proximoTicker, 5000);
fotoIn = new mx.transitions.Tween(fotoCima, "_alpha", mx.transitions.easing.None.easeNone, 0, 100, 1, true);
fotoIn.onMotionFinished = function ()
{
if (fotoCima == fotomc1)
{
mclFoto.unloadClip(fotomc2);
fotomc1.swapDepths(fotomc2);
fotoCima = fotomc2;
}
else
{
mclFoto.unloadClip(fotomc1);
fotomc2.swapDepths(fotomc1);
fotoCima = fotomc1;
} // end else if
};
};
mclFoto.addListener(this);
} // End of the function
function desceLegenda()
{
var _loc1 = new mx.transitions.Tween(legenda_mc, "_y", mx.transitions.easing.Strong.easeOut, legenda_mc._y, leg_esconde, 1.500000E+000, true);
} // End of the function
function sobeLegenda()
{
var _loc1 = new mx.transitions.Tween(legenda_mc, "_y", mx.transitions.easing.Strong.easeOut, legenda_mc._y, leg_aparece, 1.500000E+000, true);
} // End of the function
var tickersXML = new XML();
tickersXML.ignoreWhite = true;
tickersXML.onLoad = function (success)
{
if (success)
{
sobeLegenda();
n_tickers = tickersXML.firstChild.childNodes.length;
ticker_atual = n_tickers;
prox_btn.onRelease = function ()
{
if (fotoIn.position == fotoIn.finish)
{
proximoTicker();
} // end if
};
ant_btn.onRelease = function ()
{
if (fotoIn.position == fotoIn.finish)
{
anteriorTicker();
} // end if
};
proximoTicker();
menu._visible = false;
var _loc5 = menu._x;
var _loc4 = 25;
for (var _loc2 = 0; _loc2 < n_tickers; ++_loc2)
{
var _loc3 = menu.duplicateMovieClip("menu" + _loc2, _loc2 + 5);
_loc3._x = _loc2 * _loc4 + _loc5;
_loc3.numero = _loc2;
_loc3.numero_txt.text = _loc2 + 1;
_loc3.botao.onRelease = function ()
{
if (fotoIn.position == fotoIn.finish)
{
vaiParaTicker(this._parent.numero);
} // end if
};
} // end of for
}
else
{
sobeLegenda();
legenda_mc.titulo_txt.text = "Ocorreu um erro";
legenda_mc.texto_txt.text = "Por favor entre em contato com a administração";
} // end else if
};
this.createEmptyMovieClip("fotomc1", 2);
this.createEmptyMovieClip("fotomc2", 1);
fotomc1._x = fotomc2._x = area_mc._x;
fotomc1._y = fotomc2._y = area_mc._y;
fotomc1._yscale = 100;
fotoCima = fotomc1;
legenda_mc.swapDepths(3);
//area_mc.onLoad = sobeLegenda;
// area_mc.onRollOut = desceLegenda;
area_mc._alpha = 0;
area_mc.swapDepths(4);
var leg_aparece = legenda_mc._y;
var leg_esconde = legenda_mc._y + legenda_mc._height + 1;
legenda_mc._y = leg_esconde;
legenda_mc.setMask(mascara_mc);
tickersXML.load("../tickers.xml");
Stage.showMenu = false;
Stage.scaleMode = "noScale";
null;Discussão (1)
Carregando comentários...