Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Onde errei com a function "duplicateMovieClip()"? To apanhando em AS... tá f***! :)
_root[target].duplicateMovieClip("newtarget" + i, _root.getNextHighestDepth());
this["newtarget" + i]._y= 200;
O fonte completo:
obs: o palco está vazio, tudo é criado by AS.
this._lockroot = true;System.useCodepage = true;var fotos:Array = new Array();function init():Void { xmlData = new XML(); xmlData.ignoreWhite = true; xmlData.onLoad = function(loaded) { if (loaded) { xmlNode = this.firstChild; var f = this.firstChild.childNodes; //listando conteúdo do nó e inserindo no array de fotos for (var i = 0; i<f.length; i++) { var novaimg:Object = new Object(); //criando o objeto de cada foto novaimg = f[i].attributes.ft; fotos[i] = novaimg; // Cria o mc, carrega a foto e a posiciona no palco. carregarFoto("Imagens/"+fotos[i], "alvoFoto"+i, 200+Number(i), f.length); } } }; xmlData.load("Imagens/fotos.xml");}function carregarFoto(url:String, target:String, Nivel:Number, qntd_fotos) { this.createEmptyMovieClip(target, Nivel); var mcl:MovieClipLoader = new MovieClipLoader(); var list:Object = new Object(); mcl.addListener(list); mcl.loadClip(url, target); list.onLoadComplete = function(mc:MovieClip) { list.onLoadInit = function(mc:MovieClip) { //Pega a propriedade _width da foto (na verdade: do mc) tm = mc._width; // enquanto i menor que (quantidade de fotos) for (var i = 0; i<qntd_fotos; i++) { if (mcx_ant == '') { _root[target]._x = 0; } if (target == ("alvoFoto"+i) and (target != '')) { _root[target]._x = _global.mcx_ant+tm_ant+2; } if ((i == qntd_fotos -1) and (target == "alvoFoto" + (qntd_fotos-1))){ _root[target].duplicateMovieClip("newtarget" + i, _root.getNextHighestDepth()); newtarget3._y= 200; trace(i); trace(target); trace(newtarget3._x); } } _global.mcx_ant = _root[target]._x; _global.tm_ant = tm; }; };}_global.mcx_ant = '';init();
Será q não é por causa do "MovieClipLoader"??? Será que a function duplicate não funciona com o "MovieClipLoader"???Carregando comentários...