Jump to content

i know im an idiot- help with button


Caitlin-havener

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...

why dont you simplify your buttons to:MC_Button.onRollOver = function () {//code}MC_Button.onRollOut = function () {//code}MC_Button.onPress = function () {//code}etc..

Link to comment
Share on other sites

  • 3 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...