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

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
Sign in to follow this  

×