o codigo é o seguinte:
CODE
onEnterFrame = function() {
TxtCapa.text = "carregando texto...";
CarregaTxt = new LoadVars();
CarregaTxt.onLoad = function (carregado) {
if (carregado) {
TxtCapa.text = this.TextoCapa;
delete onEnterFrame;
}
else {
TxtCapa.text = "Falha ao carregar texto";
}
}
CarregaTxt.load("texto_capa.txt");
}
// não coloquei todo o código do MCL pois o problema não é com ele hahhaha
var carregador:MovieClipLoader = new MovieClipLoader();
var carrega:Object = new Object();
function CarregaFoto():Void {
carrega.onLoadProgress = function (fotos:MovieClip, carregado:Number, total:Number):Void {
...
}
carrega.onLoadComplete = function():Void {
...
desc.text = CarregaTxt[ImgCapa + i]; // aqui onde não estou conseguindo automatizar...
// tentei assim e tbm não deu certo
//desc.text = CarregaTxt.ImgCapa + i;
}
carrega.onLoadInit = function() {
...
}
}
CarregaFoto();
carregador.addListener(carrega);
// nos botoes...
b1.onRelease = function() {
carregador.loadClip("imagens/escritorio/fachada.jpg", fotos);
i = 1; // variavel que indicará qual foto está sendo visualizada
}
TxtCapa.text = "carregando texto...";
CarregaTxt = new LoadVars();
CarregaTxt.onLoad = function (carregado) {
if (carregado) {
TxtCapa.text = this.TextoCapa;
delete onEnterFrame;
}
else {
TxtCapa.text = "Falha ao carregar texto";
}
}
CarregaTxt.load("texto_capa.txt");
}
// não coloquei todo o código do MCL pois o problema não é com ele hahhaha
var carregador:MovieClipLoader = new MovieClipLoader();
var carrega:Object = new Object();
function CarregaFoto():Void {
carrega.onLoadProgress = function (fotos:MovieClip, carregado:Number, total:Number):Void {
...
}
carrega.onLoadComplete = function():Void {
...
desc.text = CarregaTxt[ImgCapa + i]; // aqui onde não estou conseguindo automatizar...
// tentei assim e tbm não deu certo
//desc.text = CarregaTxt.ImgCapa + i;
}
carrega.onLoadInit = function() {
...
}
}
CarregaFoto();
carregador.addListener(carrega);
// nos botoes...
b1.onRelease = function() {
carregador.loadClip("imagens/escritorio/fachada.jpg", fotos);
i = 1; // variavel que indicará qual foto está sendo visualizada
}
se eu fizer assim:
CODE
...
carrega.onLoadComplete = function():Void {
...
if (i == 1) {
desc.text = CarregaTxt.imgCapa1;
}
if (i == 2) {
desc.text = CarregaTxt.imgCapa2;
}
e assim por diante...
}
...
carrega.onLoadComplete = function():Void {
...
if (i == 1) {
desc.text = CarregaTxt.imgCapa1;
}
if (i == 2) {
desc.text = CarregaTxt.imgCapa2;
}
e assim por diante...
}
...
funciona! tem uma galeria, q tem + de 20 fotos, daria um pokinho de trabalho fazer desta forma....
aí quiz automatizar, pegando a var i da foto e concatenando ao "ImgCapa" que está no txt, mas está aparecendo "NaN" ou "undefined"...
onde estou errando???

Help














