2 Replies Latest reply on Jun 29, 2006 12:50 AM by Newsgroup_User

    duplicateMovieClip() not consistent

    timothytrice
      This is the case in all browsers that I'm aware of.

      This is my hurricane website in question.

      I have the following piece of code that takes a movie clip from my library, duplicates and moves to a coordinate based on information retrieved from DB. During testing, that information doesn't change (latitude and longitude). I've tested the movie to output those values to a text field and that has been consistent. I've also tested the actual stage values and the variables...everything is consistent...except that the icon does not consistently appear in the same location. It either appears where it should or appears just below my header bar.

      This is my code. I appreciate anyone's input.

      myData = new LoadVars();
      myData.onLoad = function(success){
      if (success) {
      if (_root.myData.rows == 0) {
      txtStatus.text = "There are no current storms."
      } else {
      for (i=1; i<=_root.myData.rows; i++)
      {
      var basin:String = _root.myData["basin" + i].toLowerCase();
      var thisName:String = _root.myData["name" + i].toLowerCase();
      stormName = basin + "_" + myYear + "/" + _root.myData["storm_num_yr" + i] + "_" + thisName + "/";
      stormLat = _root.myData["lat" + i];
      stormLon = _root.myData["lon" + i];
      stormWind = _root.myData["wind" + i];
      if (stormWind < 35) {
      symbol = movTD;
      /* repetitive portions of if code left out */
      }
      each_lat = (mapHolder._height/90); //where 90 is the height of my map in degrees
      each_lon = (mapHolder._width/180); //where 180 is the width of my map in degrees
      icon_num_y = (((90 - stormLat) * each_lat) + mapHolder._y); //the value I've used for stormLat is 30
      icon_num_x = (((180 - stormLon) * each_lon) + mapHolder._x); //the value I've used for stormLon is 97
      symbol.duplicateMovieClip(stormName, this.getNextHighestDepth(), {_x:icon_num_x, _y:icon_num_y});
      txtStatus.text = "Storm Info Received!";
      }
      }
      } else {
      txtStatus.text = "Error Receiving Storm Info";
      }
      }
      myData.load('/phc_incs/current_data.php');