0 Replies Latest reply on Aug 8, 2007 7:55 AM by Nejkodebejko1

    Dynamicli populated grid


      I hope that someone here can help me. Here it goes. I am populating my flash scene with a dynamic grid whitch consists of MCs that contain a button. There are generated in 90 buttons Y and 120 buttons X. Making a tottal of 10.800 buttons that are generated.

      I will post my code for better understanding. I have two different MCs. One, square is normal, and the other, square_s is the occupied state of the button.

      Now i would like to import a xml file, that would have a id number of the field and the state of it (normal or occupied). That id field would than be compared to the "k" variable in the code bellow. And than depending on the xml state of the button it would display the propper MC. I am a beginner at AS, so i would be very grateful for any help given to me.

      In the code;

      if(k==2 or k==2010){
      duplicateMovieClip ("square_s", "square_s"+k, k);

      // setting the x position of the duplicated square movieclips
      setProperty ("square_s"+k, _x, distance*i);
      // setting the y position of the duplicated square movieclips
      setProperty ("square_s"+k, _y, distance*j);
      // incrmenting the value of k

      i was just testing to see if i set a random number of a field, if it will dissplay correctly. The new code should be something like this;


      And one more thing. How could i apply a link in the code bellow, so it woul generate dynamicly. Ex. index.php?field="(The K variable)"? I just dont know how to do it.

      I hope it is not too complicated or anythink. I bet that it isnt going to be souch a problem for all you experts out there. I would like to thank everyone in advance. Thank you.