3 Replies Latest reply on Sep 2, 2009 12:48 PM by kglad

    How do you stop/disable createEmptyMovieClip function

    ScottLuker

      I am designing a graph to allow line drawing. After the user draws the line, they will drag words (movieclips) from a menu onto to the graph. I am not able to turn of the line drawing function, so when the words are dragged another line is created. I tried to turn off the line drawing onRollOver of the word with no luck. Here is what I'm doing.

       

      Draw line function:

       

      var isDown:Boolean = false;
      var xPos1:Number;
      var yPos1:Number;
      var xPos2:Number;
      var yPos2:Number;

       

      _root.onMouseDown = function() {

       

      createLine("line")
      createLine("line2")
      intervalID = setInterval(startTimer, 1);

       


      if (isDown == false) {
      xPos1 = _xmouse;
      yPos1 = _ymouse;
      } else {

       

      xPos2 = _xmouse;
      yPos2 = _ymouse;
      }

       

      };
      _root.onMouseUp = function() {
      isDown = false;
      drawLine(xPos1,yPos1,_xmouse,_ymouse);
      clearInterval(intervalID);
      //createLine("line2")
      };

       

      function startTimer() {
      //line.clear();
      isDown = true;
      moveLine(xPos1,yPos1,_xmouse,_ymouse);
      }

       

      function drawLine(xValue1, yValue1, xValue2, yValue2) {

       

      line.lineStyle(7, 0xFF0000, 100);
      line.moveTo(xPos1,yPos1);
      line.lineTo(_xmouse,_ymouse);
      }

       

      function moveLine(xValue1, yValue1, xValue2, yValue2) {
      line2.clear();
      line2.lineStyle(7, 0xFF0000, 100);
      line2.moveTo(xPos1,yPos1);
      line2.lineTo(_xmouse,_ymouse);
      }

       

      function createLine(movieClip){
      _root.createEmptyMovieClip(movieClip,_root.getNextHighestDepth());

       

      }

       


      The movieclip equil should disable the drawing tool on rollover:

       

      equil.onRollOver = function():Void {
           delete(this._parent.createLine.onRelease);
      }

       

      Thanks for any help.