Symbols (HTML5 Canvas) - Assign Classes?
Copy link to clipboard
Copied
Is it possible in HTML Canvas movies to assign classes to symbols?
I can see this is possible in ActionScript movies through the Symbol Properties panel > ActtionScript Linkage to enter a class. But in HTML5 Canvas movies, that area is disabled.
Copy link to clipboard
Copied
By class, I'm referinng to CCC and JQuery type classes, so that I can reference a number of symbols without having to use seperate IDs.
Copy link to clipboard
Copied
CCC should be CSS...
Copy link to clipboard
Copied
Hi.
If you're talking about components, you can use the className or classList properties to manipulate the class names.
Or you can just use the classes that Animate generates automatically for the components based on their types. For example:
Button -> ui-button
CheckBox -> ui-checkbox
ComboBox -> ui-combobox
So if you want to select all combo boxes, you can write:
stage.on("drawend", function()
{
console.log(document.querySelectorAll(".ui-combobox"));
}, this, true);
I hope this helps.
Regards,
JC
Copy link to clipboard
Copied
Thanks JC. Useful information.
However, my question was about classes for symbols (e.g. graphic, buttons etc), not components.
Copy link to clipboard
Copied
Any chance on an answer to this?
Copy link to clipboard
Copied
If symbols can't have classes (as opposed to IDs...) because they are part of Canvas, and not in the DOM, then is there a way that. For example, to refer as elements of an array, or something else?
Copy link to clipboard
Copied
If Animate HTML5 Canvas is using CreateJS, there seems to be an addClass method. Can I use this to ssign classes to symbols?

