Jump to content

i know im an idiot- help with button


Caitlin-havener
 Share

Recommended Posts

Newb here. Makin buttons but the one for the code below won't roll out! It also doesn't respond quickly when I click the button. Please help!stop();lingerie_btn.addEventListener(MouseEvent.MOUSE_OVER, onOver);lingerie_btn.addEventListener(MouseEvent.MOUSE_DOWN, onClick);lingerie_btn.addEventListener(MouseEvent.MOUSE_UP, onUp);function onOver(e:MouseEvent):void{lingerie_btn.gotoAndStop("over");}function onClick(e:MouseEvent):void{lingerie_btn.gotoAndPlay("down");}function onUp(e:MouseEvent):void{lingerie_btn.gotoAndStop("up");}

Link to comment
Share on other sites

The reason it won't roll out is you need to add an event listener and function for the mouse going out (or rolling off). Otherwise it will just stay in the roll over state.lingerie_btn.addEventListener(MouseEvent.MOUSE_OUT, onOut);function onOut(e:MouseEvent):void{lingerie_btn.gotoAndStop("up"); // Or whatever frame you want}I can't quite work out why it wouldn't be doing anything when you click. Perhaps it has something to do with the fact that you're using the gotoAndPlay method?

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...