Jump to content
Sign in to follow this  
Caitlin-havener

i know im an idiot- help with button

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");}

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

i belive he has coded in actionscript3 and youve used actionscript 2 . He could actualy switch to actionscript two as there doesnt seem a reason to use actionscript 3 in this example. it is correct

Edited by hansolo

Share this post


Link to post
Share on other sites

Please try not to resurrect old topics...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...