# Help! Convert simple Flash AS2 code to AS3

**URL:** <https://forum.kirupa.com/t/help-convert-simple-flash-as2-code-to-as3/320491>\
**Category:** flash\
**Created:** [March 24, 2011, 8:55pm UTC](https://forum.kirupa.com/t/help-convert-simple-flash-as2-code-to-as3/320491 "2011-03-24T20:55:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolle\_CG](https://avatars.discourse-cdn.com/v4/letter/n/a88e57/32.png) [@nicolle\_CG](https://forum.kirupa.com/u/nicolle_CG)\
**Post date:** [March 24, 2011, 8:55pm UTC](https://forum.kirupa.com/t/help-convert-simple-flash-as2-code-to-as3/320491/1 "2011-03-24T20:55:10Z")

</div>

Hi everyone,  
I’m a Flash beginner and followed a tutorial: [http://www.webwasp.co.uk/tutorials/018/tutorial.php](http://www.webwasp.co.uk/tutorials/018/tutorial.php) … to learn how to make a “live paint/draw” effect. I didn’t realize that if I made something in AS2, I wouldn’t be able to embed it (and have it work) into my root AS3 file, where I’ve got a bunch of other stuff going on. I’ve tried following tips on how to change AS2 code to AS3, but it just doesn’t work. I know it’s simple code, and that some genius out there can figure it out, but I’m at a loss. Please help!

```auto
_root.createEmptyMovieClip("myLine", 0);

_root.onMouseDown = function() {
   myLine.moveTo(_xmouse, _ymouse);
   ranWidth = Math.round((Math.random() * 10)+2);
   myLine.lineStyle(ranWidth, 0xff0000, 100);
   _root.onMouseMove = function() {
      myLine.lineTo(_xmouse, _ymouse);
   }
}

_root.onMouseUp = function() {
   _root.onMouseMove = noLine;
}

```

Thanks in advance!  
Signed,

Nicolle  
Flash Desperado
