# Short code from ActionScript2 to ActionScript3

**URL:** <https://forum.kirupa.com/t/short-code-from-actionscript2-to-actionscript3/299235>\
**Category:** flash\
**Created:** [November 1, 2009, 11:07pm UTC](https://forum.kirupa.com/t/short-code-from-actionscript2-to-actionscript3/299235 "2009-11-01T23:07:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hogviel](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@hogviel](https://forum.kirupa.com/u/hogviel)\
**Post date:** [November 1, 2009, 11:07pm UTC](https://forum.kirupa.com/t/short-code-from-actionscript2-to-actionscript3/299235/1 "2009-11-01T23:07:05Z")

</div>

Hello,

I need some assistance. I am making a coloring book with coloring boxes and colorable areas.

The problem is that I have this code in ActionScript 2 but I need it in ActionScript 3.  
Can someone help me?

This code is behind the red color box (MovieClip)  
on (press) {  
\_root.r = 255;  
\_root.g = 0;  
\_root.b = 0;  
}

This code is behind the colorable area: (MovieClip)  
onClipEvent (load) {  
myColor = new Color(this);  
myColorTransform = new Object();  
}  
on (release) {  
myColorTransform.ra = \_root.r;  
myColorTransform.ga = \_root.g;  
myColorTransform.ba = \_root.b;  
myColor.setTransform(myColorTransform);  
}

The colorbook I am trying to do is similar to the tutorilas on the website  
[http://www.kirupa.com/developer/mx2004/coloringbook.htm](http://www.kirupa.com/forum/../developer/mx2004/coloringbook.htm)
