Text on button issues
by Mike Land
on
Jul 4, 2008 at 7:52:25 am
Hello all!
I've just begun using Flash for web design and have run into a problem I hope is easily fixed:
In creating navigation links, I've made rectangle boxes with text written over them indicating their destinations (home, mission, contact etc.) I've applied effects to the down and over events (drop shadow, knockout) and all is well with the rectangle. Unfortunately, when I mouse over the text itself, the effects are not realized. I've converted the text to buttons.
I've been searching for a way to combine them as a graphic and then reconvert them to a unified button, but have done so without any luck. Will I have to design them in Illustrator and import them as independent files (the image quality suffers when I do, so I hope not!). Or is this simply something I will have to deal with when I begin scripting?
Please help!
--Also, on a similar note, I was getting this weird flickering every time I moused over the links when I tested the movie, even when the mouse was stationary. I added 0% alpha rectangles to the up and over keyframes and it solved the problem, but I imagine there's an easier way to avoid the flickering.
Thanks in advance, and hope you all enjoy the holiday
Re: Text on button issues by Sher Ali on Jul 4, 2008 at 9:24:42 am
There are two ways to fix your problem.
1- Set the mouseEnabled property of the text field inside the button to false, like:
myButton.theText.mouseEnabled = false;
2- Or use the mouseChildren property of the button to prevent the child objects of the button to respond to mouse events.
myButton.mouseChildren = false;
Re: Text on button issues by Dan Browne on Jul 6, 2008 at 9:43:33 pm
Make sure the text is set to static text, I always used to have this problem when I did somethings with dynamic text and forgot to change back to static. So just make sure the text field is set to static text and hopefully that will sort your problem.
Dan Browne
Hawkes Bay, New Zealand
Cloud South Films
www.cloudsouthfilms.co.nz
Re: Text on button issues by Mike Land on Jul 7, 2008 at 2:55:02 pm
Thanks very much,
Dan's answer definitely took the cake! I was almost certain I'd tried testing input, dynamic, and static texts, but apparently not... It was so obvious and it worked liked a charm.
Quick question to Sher: I tried scripting the mouseChildren property, (please bear with me, I'm a Flash newbie) but couldn't figure whether to put it in a function or var basic or what. Could you tell me what context to put those kinds of commands in?
Re: Text on button issues by Sher Ali on Jul 7, 2008 at 5:14:59 pm
for simplicity you have to write that code in a keyframe in the timeline where your button is residing. For example if your button is placed on the root/main timeline then you have to attach the code with a keyframe on the root/main timeline.