1 Reply Latest reply on May 23, 2007 4:06 AM by jjminjj

    line basic

    jjminjj
      i strat learning AS basic.
      --------------------------
      now i have a publem.i create Mc = 5 .And it's random = 3.
      i want to konw when i click the mc it's start drawing line and stop draing when
      we click some node.
      i know it's control by ._xmouse,._ymouse but i don't know insert code where.
      --------------------------
      somebody guide for me.
      thenks.
        • 1. Re: line basic
          jjminjj Level 1
          var numberofnodes = 3;
          for (i=1; i<=numberofnodes; i++) {
          this.createEmptyMovieClip("node"+i,i);
          var node = eval("node"+i);
          var type = 1+Math.floor(Math.random()*5);

          trace(type);
          if (type == 1) {
          node.lineStyle(1,0x000000,100);
          node.beginFill(0xFD0B0B);
          node.moveTo(20,30);
          node.lineTo(50,60);
          node.lineTo(20,60);
          node.endFill();
          node._x = Math.floor(Math.random()*550);
          node._y = Math.floor(Math.random()*400);
          } else if (type == 2) {

          node.lineStyle(1,0x530B45,100);
          node.beginFill(0xFF00FF);
          node.moveTo(20,20);
          node.lineTo(40,20);
          node.lineTo(40,40);
          node.lineTo(20,40);
          node.endFill();
          node._x = Math.floor(Math.random()*550);
          node._y = Math.floor(Math.random()*400);
          } else if (type == 3) {
          node.lineStyle(1,0x7324A8,100);
          node.beginFill(0xDAD90C);
          node.moveTo(30,10);
          node.lineTo(40,20);
          node.lineTo(40,30);
          node.lineTo(20,30);
          node.lineTo(20,20);
          node.endFill();
          node._x = Math.floor(Math.random()*550);
          node._y = Math.floor(Math.random()*400);
          } else if (type == 4) {
          node.lineStyle(1,0xBD540F,100);
          node.beginFill(0x0E5FD8);
          node.moveTo(30,10);
          node.lineTo(40,20);
          node.lineTo(40,30);
          node.lineTo(30,40);
          node.lineTo(20,30);
          node.lineTo(20,20);
          node.endFill();
          node._x = Math.floor(Math.random()*550);
          node._y = Math.floor(Math.random()*400);
          } else if (type == 5) {
          node.lineStyle(0,044015,100);
          node.beginFill(0x0FE850);
          node.moveTo(50,50);
          node.curveTo(60,50,60,40);
          node.curveTo(60,30,50,30);
          node.curveTo(40,30,40,40);
          node.curveTo(40,50,50,50);
          node.endFill();
          node._x = Math.floor(Math.random()*550);
          node._y = Math.floor(Math.random()*400);

          }
          **************
          it' code
          i don't know insert code where.
          :-)