-
attachMovie() problem!!
hi there.. well im working on a small info displayer for 3 days now..
basically it works as this:
it sends a string to the SRC="" parameter like ?n=2 //where n is the number of results found
&modelo1= // this is the first row
&modelo2= // this is the second row
this two vars contain several values delimited by "|"
in actionscript i used for() to loop the number of results found and display the info for each modelo.
this is where things get a bit ugly... it seems that all the actionscript is ok... becouse "attachMovie("mov_"+i, movie_name, 3);" is indeed attaching a movie with all the data.. but when it cicles to the next it seems to erase the first one.
i've ran out of imagination to on this one.. i really aprieciate f sumone can helpme...
sorry for the big explaination... im pretty noob on forums
thnx
Code:
var i;
//this is send in view.swf?n=2
// &modelo1=1|foto.jpg|....
//this vars has been forced for debugging
var n=2;
modelo1 = "1|foto.jpg|residencia|casa|3|2|742 Evergreen Terrace|Fox Studios|Springfield|baja california";
modelo2 = "1|foto.jpg|residencia|casa|5|2|742 Evergreen Terrace|Fox Studios|Springfield|baja california";
arr = new Array();
//
for (i=0; i<n; i++) {
modelo = "modelo"+i;
arr = eval(modelo).split("|");
movie_name = "Movie_" + i;
attachMovie("mov_"+i, movie_name, 3);
eval(movie_name).modelo_titulo.htmlText += "<b>"+arr[2]+" • "+ arr[3]+"</b>";
eval(movie_name).modelo_descripcion.htmlText += arr[4]+" Recamara(s), "+arr[5]+" Baños, <br>"+arr[6]+", "+arr[7]+" "+arr[8]+"<br>"+arr[9];
if(i==1){ x=24; }
eval(movie_name)._x=x;
eval(movie_name)._y=4;
x += 132.3;
}
stop();
-
attach at individual depths, or they will overwrite each other
attachMovie("mov_"+i, movie_name, i+1000);
-
The third parameter in attachMovie is the depth. Only one thing can occupy each depth so when you attach the second one to the same depth it has to replace whatever was at that depth.
try this:
attachMovie("mov_"+i, movie_name, i); //changed 3 to i
or if you have stuff on 0, 1 and 2 that you don't want to replace
attachMovie("mov_"+i, movie_name, 3+i);
-
WHOOOOA man thnk u guys!!! this is killah!!
thnx thnx thnx thnxx!!!