A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Oct 2007
    Posts
    4

    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();

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    attach at individual depths, or they will overwrite each other

    attachMovie("mov_"+i, movie_name, i+1000);

  3. #3
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Kaiserslautern
    Posts
    2,429
    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);

  4. #4
    Junior Member
    Join Date
    Oct 2007
    Posts
    4
    WHOOOOA man thnk u guys!!! this is killah!!

    thnx thnx thnx thnxx!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts




Click Here to Expand Forum to Full Width


HTML5 Development Center