2

I'm not sure if I'm using this transform correctly. I'm trying to lock in a color adjustment on a button when it has been clicked once. I tried starting off adjusting the alpha=0, and it worked ok. I'm not very good with as3 so a little help would be very nice.

I get this error: "ReferenceError: Error #1056: Cannot create property colorTransform on flash.display.SimpleButton. at movie_fla::MainTimeline/onMouseClickEvent()"

Thanks Terry

stop();
this.wheelsMain.inner4.Inner1btn.addEventListener(MouseEvent.CLICK, onMouseClickEvent);

function onMouseClickEvent(event:Event) {

  Object(this).wheelsMain.inner4.Inner1btn.colorTransform = new ColorTransform(1, 1, 1, 1, 20, 0, 0,0);
  }
Dennis1973
  • 105
  • 1
  • 1
  • 6

1 Answers1

3

You need to use the "transform" property...

like this:

stop();

this.wheelsMain.inner4.Inner1btn.addEventListener(MouseEvent.CLICK, onMouseClickEvent);

function onMouseClickEvent(event:Event) {

  event.target.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 20, 0, 0,0);
  }

whatch the example at the bottom of this link

  • You can shorten the code with "event.target" which points to the button directly!

Good Luck!!

EDIT: * If I helped you - please mark as answered!

Yitzchak
  • 3,303
  • 3
  • 30
  • 50