A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Toggle color of movieClip with a button

  1. #1
    Junior Member
    Join Date
    Jul 2000
    Posts
    7

    Toggle color of movieClip with a button

    I want to press a button and have a movieClip change to blue. When I press the same button again, I want the movie clip to change back to white - Thoughts?

  2. #2
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    PHP Code:

    //create class level or variable outside click function called toggle0:int=0;
    btn0.addEventListener(MouseEvent.CLICK,btnClick,false,0,true);
    fuinction btnClick(e:MouseEvent):void{
    if(
    toggle0==0){
    toggle0=1;
    //code to change to blue
    }else{
    //code to change back to orgianol color
    toggle0=0;
    }

    ~calmchess~

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