Skip to main content
Participant
May 2, 2013
Question

Conversion of as2 code into as3

  • May 2, 2013
  • 1 reply
  • 408 views

     _root.attachMovie("brush","brush",10)

     _root.brush.onEnterFrame=function()

     {

               Mouse.hide()

               startDrag(this,true)

               new Color (this.brushColor).setRGB(_root.brushColor)

 

     }

     //////

     onClipEvent (load) {

          myColor = 0x000000

          new Color(this).setRGB(myColor);

     }

     on (release) {

               _root.brushColor= myColor;

     }

     ////

     on(press)

     {

               new Color(this).setRGB(_root.brushColor)

     }

This topic has been closed for replies.

1 reply

Participating Frequently
May 2, 2013

In as3 we have

var mc:MovieClip = new MovieClip()

var tt:ColorTransform = new ColorTransform()

tt.color = somecolor;

mc.addEventListener(Event.ENTER_FRAME,runf);

mc.addEventListener(MouseEvent.DOWN,downf);

mc.addEventListener(MouseEvent.UP,upf);

function runf(e:Event):void{

mc. startDrag();

}

function downf(e:MouseEvent):void{

mc. startDrag();

tt.color = somecolor;

mc.transform = tt;

}

pls let me know is this helpfull..?

function upf(e:MouseEvent):void{

mc.stopDrag();

}