5 Replies Latest reply on Jun 20, 2007 11:02 PM by MurMeeKeer

    functions on a timeline

    Optikalefx Level 1
      So i have some bars that move up and down randomly when a song is being played. the bars movieclip is located at _root.iphone.body.bars
      i have a mute button that makes all the bars go to height 0 and stop the music
      the button for that is located
      _root.iphone.body.mute
      the actions for the function to make the bars move (function heightt() ) is on the bars movieclip timeline
      the actions for the function to make the onRelease of the mute button is also inside the bars movieclip timeline
      the actions to make a song play when u click a song button are located on _root.iphone
      so what i want to do is access function heightt() when u click one of the song buttons.

      so far i have
      song1_btn.onRelease = function() {
      body.bars.heightt();
      }

      that makes the bars move from their 0 height, but they dont animate.

      why?

      here is the function to make the bars move
      myInterval = setInterval(heightt, 200);
      function heightt() {
      for (i=1; i<=5; i++) {
      set("newHeight"+i, Math.floor(Math.random()*57));
      var motion:Object = new Tween(eval("b"+i), "_height", Strong.easeOut, eval("b"+i)._height, eval("newHeight"+i), .2, true);
      }
      }

      so i want to call that function from clicking the music buttons, but i cant seem to get it right cuz they are on different timelines, or maybe it has to do with the interval, im not sure.