A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: Movie clip as button

  1. #1
    Junior Member
    Join Date
    Jan 2011
    Posts
    5

    Movie clip as button

    I want to do a movie clip as a button. And when you roll over the mc, there`s an effect. But when i do this animation reverse(from the end to the start) in frame "bitek1out", and I leave the button, it doesn`t work (actually nothing happens-it returns to look as when you don`t roll over). Where`s the error?

    Code:
    import  flash.display.MovieClip; 
    import  flash.events.MouseEvent; 
    
    bitek1.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
    bitek1.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
    bitek1.addEventListener(MouseEvent.CLICK, onClickHandler);
    bitek1.addEventListener(MouseEvent.MOUSE_DOWN, onPressHandler);
    bitek1.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
    bitek1.buttonMode = true;
    bitek1.useHandCursor = true;
    
    function onRollOverHandler(myEvent:MouseEvent){
    bitek1.gotoAndPlay("bitek1over");
    }
    
    function onRollOutHandler(myEvent:MouseEvent){
    bitek1.gotoAndPlay("bitek1out");
    }
    function onClickHandler(myEvent:MouseEvent){
    bitek1.gotoAndPlay("bitek1click");
    }
    function onPressHandler(myEvent:MouseEvent)
    { 
    bitek1.gotoAndPlay("bitek1mousedown");
    } 
    function onReleaseHandler(myEvent:MouseEvent)
    { 
    bitek1.gotoAndPlay("bitek1mouseup");
    }
    Attached Images Attached Images

Tags for this Thread

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