When you add a listener to a movieclip and set it’s buttonMode to true:
buttonname.buttonMode = true;
it should then display the default hand cursor.
But when you have dynamic text inside the movieclip, (even if the text feild is not selectable!) your in for a world of hurt and debugging.
That is unless your set buttonname.mouseChildren = false; which makes the text inside the mc lose focus. It’s set to true by default
Love you. Thanks!
jeff your the best, saved me a lot of stress and work. How did you find out about this!
When you make sites it’s inevitable you’re going to make menu buttons with dynamic titles. It’s just bad luck that value is set to true by default. Just another nuance of AS3 i suppose.
And who reads though the help files anyway..!
Actually I thought it was the contrary so I set mouseChildren = true so as to force the textfield to display the button cursor. After a short while, quick reflex : google + bunch of good keywords and I ended up here. Thanks !
you my friend are a genius and a godsend. lord knows how long it would have taken to work that out!
kudos. nice site by the way.
just use dynamicTXT.mouseEnabled = false;
no need for mouseChildren…
;)
Hey, yea. It probably is a really good hint. Unfortunatelly (unlike the others) I do have problems with it. If I do as you explained, my MouseEvent-Listener does not work anymore. Any Idea?
thx a lot
Paul
Again me. Found out what my Problem was about. Even if it seems strange … if I add a Listener to the Button Movie Clip, the target of the triggered Event is the textfield inside, and not the movieClip itself. Only if I set button.textfield.mouseEnabled to false or, as you did button.mouseChildren to false the button itself is the target. Does any of you get the sense in that?
This is a first class post you have saved me a world of pain too!
Awesome. Thx.
Huge Tip!
Thanks Awesome Tip
Paul – you are dead right. To turn a text field in a movie to show a link style hand cursor your have to put somethign like :
moviesname.textieldname.buttonMode = true;
Brilliant tips all round – cheers!
Sorry – last post update ( You need to also add in mouschildren = false — otherwise the mouse events dont fire properly. )
mc.buttonMode = true;
mc.mouseChildren = false;
For reference check out : http://www.xllusion.net/ed/2007/12/30/as3-buttonmode-issues/ .. implemented in in my code and works a treat
I love a first google hit that solves your problem straight away. Thanks!
Great tip, I was trying to get this done for almost 30 minutes of googleing around, then finally and luckily found your page. I recently switched from AS2 to AS3 and there are quite some things to learn, but overall it is much more powerful and forces you to write clesn oo code.
Keep up the good work!
Guys,
If you want to have the hand cursor over a particular textbox inside a movie clip, you can try this..
textBox.mouseEnabled = false;
Thanks…
I’m lucky, found you the moment i need you.
i never would’ve figured it out. AS3 is so stupid, my site is crashing like nobody’s business and I’m going to spend the night fixing it.
You saved me a lot of trouble – thank you very much!
Thank you so much! This saved me so much work!!!
lova ya’
Thanks a million, I’m desiging a product to help millions of children, wonderful tip!
Wow!!
I struggled so hard on this. I created so many work around and could not figure out why the Movie Clip would not register as the event target.
This is gold. Had to reverse engineer a bunch of stuff but so happy I got it working as I logically think it should.
Thanks so much! This saved a lot of hair pulling.
You saved me, after a year of not using flash, I almost forgot about this.
GOAAAL!!!!
Thanx. Totally fresh to Actionscript 3.0 but this thread helped me out big time!
Cheers! Just what I was looking for.
Thanks for the tip!
THANK YOU SO MUCH!!!!!!!!!!!!!!!!!!!!!
Thank you very much for saving my time.
Wow, came up first for me in Google when searching for “as3 cursor button.” Thank you!!
Thank you very much!
thaaaaankkssssssssss!
the weir thing is thar I have done that before without the buttonname.mouseChildren = false; and had the same result! Dont know how!
Thanks man! Saved me!
Access of possibly undefined property mouseChildren through a reference with static type flash.display:SimpleButton.
I am getting this error, when i use the
mc.mouseChildren = false;
do i need to add anything else too?
Just has to change useHandCursor to buttonMode to display the hand, but thanks
I’ve got some text inside a button moviec, and the text field is bigger than the parent moviclip. Which means that the hit area for the mouseOver listener is bigger than the button … how do i set it so children text fields and MC’s don’t affect the hit area of the button?
thanks. this has bothered me for longggggggggggggggggg.
Cheers Jeff, saved me loads of searching
Thanks for the tip. You saved my time
Seriously…. you are a gentleman and a scholar. I been spending my days (after work, that is) trawling through tutorials and forums, trying to learn AS3 the <> way. Sure, I’ve found some seriously sweet tutorials in that time…. but this button issue of mine was driving me nuts, and your simple fix was so perfect for what I wanted to do that I just had to drop a ‘thank you’ comment. THANX!!!!!
This fix is brilliant ! You are Awesome! Thanks so much!!
I love how many people are declaring their love for you here.
Genius and super simple fix. Thanks so much for posting, you saved me hours of messing.
Also is necessary use
useHandCursor = true;
buttonMode = true;
mouseChildren = false;