0 Replies Latest reply on Sep 19, 2006 11:39 PM by Newsgroup_User

    [FLASH MX] problem with textfield et numeric variable

    Level 7
      hi everyone
      I want to make an automatic slideshow
      i ve an editable textfield ("tempo") in wich the user write numbers ... for
      me this number should be a variable the user can change
      This value will allow me to deal as a tempo that will load picture each
      second or 2 sec ...

      here is the function :

      _global.tempo = Number(tempo.text);

      filename = ["img01.jpg", "img02.jpg", "img03.jpg", "img04.jpg",
      "img05.jpg"];
      path = "images/";
      clearInterval(displayI);
      function displayF() {
      var k = Math.floor(Math.random()*filename.length);
      while (k == prevIndex) {
      k = Math.floor(Math.random()*filename.length);
      }
      loadMovie(path+filename[k], my_mc);
      prevIndex = k;
      }
      displayF();

      //button action:

      BTrandom.onPress = function() {
      displayI = setInterval(displayF, tempo);
      updateAfterEvent();
      trace(tempo);
      };

      ---------------------------------------------
      the textfield is of course editable.
      i ve put a trace on thetempo value the problem is that when i clic on the
      BTrandom button
      the value doesn't change, it keeps the original one

      i would be realy please if someone help me to find why it doesn't work as i
      would ...

      thanks a lot