Copy link to clipboard
Copied
Hey folk,
are there restrictions around Dynamic Text in button states in HTML5?
In a simple button I have Dynamic Text in the 'Up' state. I press F6 in the 'Over' state then change that same Dynamic Text font (plus sort out the 'Hit' area) but when I test this it doesnt change for the 'Over' state when previewed or when tested on our server. It stays the same style as the 'Up' state.
An example button would be Roboto Regular 24pt on some text in the 'Up' state and then Roboto Black 24pt for the same text (but new keyframe) in the 'Over' state. I have Dynamic Text selected for both and the typeface (family) is selected from the Web Fonts area drop down (with an 'F' beside them). The 'Over' state in preview does not show the Black style when hovered over in preview.
In the above example if I changed the 'Over' font colour then that colour change shows in preview but still the 'Over' state style stays as Regular.
I've reset preferences, plus tried on my home PC and work PC with no difference. Also tested on Chrome, Firefox and Microsoft Edge. Animate CC is most recent version.
Maybe I've missed something really simple or it is just the way it is?
The explanation is a bit long winded but hope it gives a clear picture.
It's not the end of the world but thought I'd like to know for future.
Cheers
Greg
Oh sorry.
I misunderstood.
It's far from the ideal solution, but what you can do is to put the text in the over state inside of a Movie Clip.
Apparently, CreateJS don't set text fields the way we expect in frames other than the first.
I kinda tried to explain my point here:
I hope it helps.
Regards,
JC
Copy link to clipboard
Copied
Hi.
Draw a rectangle in the hit frame to be used as the hit area.
Because if you put only the text, it will be very hard to detect the mouse hovering over.
Copy link to clipboard
Copied
Hi and thanks for that but I do that anyway. I should have added that to original text (I'd waffled on long enough ha ha). But that is not the problem.
Cheers
Greg
Copy link to clipboard
Copied
Oh sorry.
I misunderstood.
It's far from the ideal solution, but what you can do is to put the text in the over state inside of a Movie Clip.
Apparently, CreateJS don't set text fields the way we expect in frames other than the first.
I kinda tried to explain my point here:
I hope it helps.
Regards,
JC
Copy link to clipboard
Copied
Thanks João, that's perfect. I converted the 'Over' state text to a movie clip and it works at no expense to the file size.
I do think maybe it is a potential bug- not a big one and with a quick work around.
kglad was correct but I'll mark yours as correct, as you took the time in the other post to gave great detail and explanation (as always).
Thanks again, João.
Copy link to clipboard
Copied
That's excellent!
You're welcome and I do appreciate your feedback.
Copy link to clipboard
Copied
No worries, João.
I was a bit hasty with my response, as there is a small pay off in file size with converting to symbols. But very small and a lot better than if all the text in the buttons had been static.
Copy link to clipboard
Copied
use static text in a button.
if you need dynamic text, use a movieclip button.
Copy link to clipboard
Copied
Ah right cheers. I was wondering if that is the only solution.
I'm trying to squeeze the file size down as much as possible (I've become obsessed with file size, performance and the users experience) where I can and hence using Dynamic Text for multiple buttons helps that- even if small file size saving.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now