36 Replies Latest reply on Jun 28, 2008 11:26 PM by __smileHare

    creating functions for movie-clips(serious problem)

    chinmayagoyal Level 1
      Hello,
      This is I think my third thread on these forums and in my previous threads I had always got some help.Well, now I have another serious problem, can you help me?
      I am unable to create a function that can control movie clips. Let me explain:-
      I have 10 movie clips on the stage and I have assigned them that whenever they crash to an object, they will go to a random position. Writing this code ten times for each movie clip would be very tedious, so, I thought about creating a function, but, it doesn't work. Here's the function, can you correct it?

      var object:movieClip;
      function position(object) {
      var testnum1:Number;
      testnum1 = random(290)+36;
      _root.object._y = -77.6;
      _root.object._x = testnum1;
      }
      position(nameofmovieclip)

      PLEASE HELP IS REQUIRED!!!!
      Thanking All,
      Chinmaya