Wednesday, April 01, 2009

Dynamic Text Fields

I had a recent issue with Dynamic Text Fields. In an interface I designed, I had a set of button symbols - just simple buttons. I didn't want to put any text labels in the buttons themselves, I wanted the text to come from an external XML file. So I set up the XML file and got the text into a Dynamic Text Field that I had in a layer above the buttons.

The problem happened when testing the movie. The buttons normal behavior was blocked by the Dynamic Text Field?!? For example, when hovering over the button, the cursor stopped being a hand cursor over the text field. Any rollover effects stopped when the cursor was over the text field. So I thought it was an issue with the text field itself, like some appearance property or something. I tried all of the settings and it didn't change anything.

After posting questions to a couple of forums, I finally got the answer. With ActionScript, you need to set the text fields mouseEnabled property to false:

textfield1.mouseEnabled = false;

That means that the text field doesn't respond to mouse events at all. Problem solved.

It seems odd to me that Dynamic Text Fields do this at all. I don't think this was a normal behavior in versions prior to CS4.

Labels: , ,

1 Comments:

Anonymous David said...

I had the exact same problem. Thanks for posting this, after migrating from CS3 I had no idea why such a simple task would be so hard in CS4... you think abode would know about things like this. Did they beta test Flash CS4 at all??

I have also had a problem with a ton of fonts not being accessible in FL CS4 which were in CS3... thats another story. One more little pain like this and Im going to switch back.

3:48 PM  

Post a Comment

<< Home