A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Simple colorTransform question

  1. #1

    Simple colorTransform question

    how do i get my movieclip to go back to its original color? here's what i got so far:
    Code:
    var colorTrans:ColorTransform = my_btn.transform.colorTransform;	
    
    my_btn.addEventListener(MouseEvent.CLICK, changeColor);
    myOther_btn.addEventListener(MouseEvent.CLICK, removeColor);
    function changeColor(evt:MouseEvent):void {
    	colorTrans.color = 0xB57726;
    	my_btn.transform.colorTransform = colorTrans;
    }
    function removeColor(evt:MouseEvent):void {
    	colorTrans.color = new ColorTransform();
    	my_btn.transform.colorTransform = colorTrans;
    }
    click my_btn and my_btn turn a goldish color (0xB57726). click another button and my_btn changes back to its original color. This script turns my_btn black (default, i suppose). I need it to lose its color transform so that it will be its orginal color, plus still have it's over state qualities. Is this possible?

  2. #2
    nevermind, i got it. chnged it to this:
    Code:
    function removeColor(evt:MouseEvent):void {
    	my_btn.transform.colorTransform = new ColorTransform();
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center