Copy link to clipboard
Copied
I am making a menu, with lots of submenus using HTML5 Canvas in Animate CC.
I am running into a weird problem.
I have simplified the problem as much as I could into this fla:
Broken Example.fla - Google Drive
What you'll see in that fla is this:
The javascript starts running a function in the background that updates these text boxes, if they exist as properties of the exportRoot object.
What I expect to see when I run this in a browser is this:
What I see is this:
If I remove the second frame however, everything works as expected.
Why does this happen? What am I doing wrong?
Hi.
This is something I've also been facing lately and I think it is a limitation of the CreateJS suite in Animate CC. I hope someone else can clarify this for us.
Because what I can tell is that text fields don't get registered as children properly - or don't get registered at all - if they aren't in the first frame.
In your case, it seems that only the first text field (lower z index) of the third frame gets registered.
Run a test logging the exportRoot or the "this" property. You'll see that only
...Copy link to clipboard
Copied
Hi.
This is something I've also been facing lately and I think it is a limitation of the CreateJS suite in Animate CC. I hope someone else can clarify this for us.
Because what I can tell is that text fields don't get registered as children properly - or don't get registered at all - if they aren't in the first frame.
In your case, it seems that only the first text field (lower z index) of the third frame gets registered.
Run a test logging the exportRoot or the "this" property. You'll see that only the "txtBoxOne" and the "txtBoxTwo" are registered as children. But, if you send the "txtBoxThree" to the bottom of the stack - index 0 - you'll see it will be the one being registered.
My workaround for this is to put the text fields that aren't in the first frame inside of a Movie Clip. In this way I can access them because the Movie Clips are always registered.
I hope it helps.
Regards,
JC
Copy link to clipboard
Copied
Thanks for the advice - turning the text into movie clips does indeed work around the problem. Definitely sounds like a bug. If anyone has any more info on this, I would appreciate it, as I am sure others that have come across this would as well.
Copy link to clipboard
Copied
Thanks for the possible solution. In my case im having 200+ text buttons so creating these as movie clips is not what im willing to do. Hopefully this problem will be fixed some point or created some other way around it.
Copy link to clipboard
Copied
If you have that many text buttons you should really be looking into creating them dynamically.
Copy link to clipboard
Copied
Thanks for tip. I actually changed all the button text from static to dynamic. File size dropped from 10mb to less than 2mb. Bolding also works if web fonts are not used.
Publishing takes still quite long time to run, need to find more things to optimize.
Copy link to clipboard
Copied
kaspers42 wrote
Thanks for tip. I actually changed all the button text from static to dynamic.
That's... not at all what I meant.
I meant generate the buttons with code instead of manually making 200+ buttons.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more