1 Reply Latest reply on Jul 7, 2006 8:32 AM by koomisan

    dynamic rollovers

    koomisan Level 1
      hello, i am trying to make a movie that has numbers spining and when you rollover a number, that number appears in a text box at the bottom right of the page.
      however, i am not able to attach the number i want to the dynamic text. the code is attached. there is an array wich gets the numbers (the array stored them, i checked), and the function i tried is on line 21 (inside PostionText function)
      if someone has any suggestions i will be very greatfull
      thank you


      function circleX(distance:Number, angle:Number):Number {
      return distance*Math.sin(Math.PI*angle/6);
      }
      function circleY(distance:Number, angle:Number):Number {
      return -distance*Math.cos(Math.PI*angle/6);
      }
      function createTextFields():Void {
      for (var i:Number = 1; i<13; i++) {
      duplicateMovieClip(number_mc, "number"+i+"_mc", i);
      //change text in textfield
      _root["number"+i+"_mc"].number_txt.text = i;
      rollOverNum = i;
      }
      }
      function PostionText(centerX:Number, centerY:Number):Void {
      for (var i:Number = 1; i<13; i++) {
      var rotation:Number = i+_xmouse/20;
      _root["number"+i+"_mc"]._x = centerX+circleX(_xmouse-100, rotation);
      _root["number"+i+"_mc"]._y = centerY+circleY(_ymouse-100, rotation);
      //make the mc a rollover button
      _root["number"+i+"_mc"].onRollOver = function() {
      output_txt.text = rollOverNum
      ;
      };
      }
      }
      // variables
      var rollOverNum:Array = new Array();
      // events for start of movie
      number_mc._visible = false;
      onEnterFrame = function () {
      PostionText(200, 200);
      };
      createTextFields();