Hello,
I couldn't get the selector $$ to work with library fonts, I had to instead iterate through the entire library and look for all instances that are fonts.
I feel like I am doing this the hard way, or I am missing something?
Tries:
$$("fonts");
but instead, need to use:
var libraryItems = dom.library.items;
var i = libraryItems.length;
while (i--) {
var item = libraryItems[i];
if (item.itemType == "font") {
processFont(item);
}
}
Sorry for the delay in replying... the forum's been a bit quiet for a bit!
It's:
$$(':font');
That's a pseudo (filter) class, just like CSS. In this case, looking for an item, the type of which, is "font".
You could also pick ":movieclip", ":graphic", etc. as well as the other pseudo properties like ":last", ":random", or ":children".
Back to your syntax, as you've just done this...
$('fonts');
...xJSFL would look for any items named "fonts", so "assets/fonts" or such like, would be found.
There's a handy table here with the all the syntaxes: http://www.xjsfl.com/support/api/elements/selectors#selectors-table