Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá pessoal uso o flash MX e estou usando os exemplos do programa Flash MX\Samples\FLA\load_images.fla
O problema que coloquei este exemplo pra carregar as imagens, e depois de tudo pronto elas demoram carregar.
Gostaria de colocar um gif animado de carregando, para que a pessoa não fique apenas olhando o fundo branco.
está sa seguinte forma :
//initialize variables and properties
square._alpha = 0;
whichPic = 1;next.onPress = function() {
if (whichPic<10 && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic++;
input = whichPic;
}
};
back.onPress = function() {
if (whichPic>1 && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic--;
input = whichPic;
}
};
_root.onEnterFrame = function() {
// when a new Photo is selected, fade out, load new image, and fade in
if (square._alpha>10 && fadeOut) {
square._alpha -= 10;
}
if (square._alpha<10) {
loadMovie("images/image"+whichPic+".jpg");
*************AQUI GOSTARIA DE COLOCAR UM GIF PRA INFORMAR QUE ESTÁ CARREGANDO************************
fadeOut = false;
fadeIn = true;
}
if (square._alpha<100 && fadeIn && !fadeOut) {
square._alpha += 10;
} else {
fadeIn = false;
}
// limit input field
if (input>8) {
holofotes._alpha=0;
fnd._alpha=0;
square._x= 45;
square._y= 0;
square._width= 715;
square._height= 500;
}else{
holofotes._alpha=100;
fnd._alpha=100;
square._x= 224.8;
square._y= 12.8;
square._width= 333.0;
square._height= 500.0;
}
// initiate change to new image when Enter key is pressed
if (Key.isDown(Key.ENTER)) {
fadeOut = true;
whichpic = input;
}
};
// if a number is entered in the input field but Enter is not pressed, change
// back to current Photo number when clicking anywhere else
inputField.onKillFocus = function() {
input = whichPic;
};
Assim:
E o gifanimado é um gif já colocado dentro do flash... na posição que você quer... ou ali você pode setar a posição... e instanciado de gifanimado
ASsim quando acabar de carregar você coloca gifanimado._visible = false
Abraços