theelephantwords
06-27-2008, 06:58 PM
hey, so in Flex i'm loading in swf's that have embedded fonts. i have a loadstack class that handles fonts, and registers them. it works fine when i call the swf file relatively, but not absolutely.
i get the error =
ArgumentError: Error #1508: The value specified for argument font is invalid.
at flash.text::Font$/registerFont()
googling the issue, no one's had it shut down when the font swf was absolute. so i was wondering if anyone had any fixes. it's loading the swf correctly, but something is weird with the applicationDomain.
in my app:
LS.addToLoader('http://omgplaylist.com/playa/fonts/kroeger05_53.swf', {type:'font', classes:['Kroeger05_53']});
in the loadstack class:
switch (queue[index][1].type) {
case 'font' :
var classes:String = queue[index][1].classes;
var f:Array = classes.split(',');
var FontLibrary:Class;
for (var k:uint = 0; k<f.length; k++) {
FontLibrary = e.target.applicationDomain.getDefinition(f[k]) as Class;
FontLibrary ? Font.registerFont(FontLibrary) : null;
}
break
}
it gets the FontLibrary correctly, but registerFont fails.
http://omgplaylist.com/playa/ is the app, the text on the bottom uses that font, it's loading relatively -
LS.addToLoader('fonts/kroeger05_53.swf', {type:'font', classes:['Kroeger05_53']});
it's not a problem for me yet, i'll be able to do it the way it is but in the future i might need to change it. i've tried checking for a policy file but that didn't do anything because it's actually getting the swf.
thanks for any help.
i get the error =
ArgumentError: Error #1508: The value specified for argument font is invalid.
at flash.text::Font$/registerFont()
googling the issue, no one's had it shut down when the font swf was absolute. so i was wondering if anyone had any fixes. it's loading the swf correctly, but something is weird with the applicationDomain.
in my app:
LS.addToLoader('http://omgplaylist.com/playa/fonts/kroeger05_53.swf', {type:'font', classes:['Kroeger05_53']});
in the loadstack class:
switch (queue[index][1].type) {
case 'font' :
var classes:String = queue[index][1].classes;
var f:Array = classes.split(',');
var FontLibrary:Class;
for (var k:uint = 0; k<f.length; k++) {
FontLibrary = e.target.applicationDomain.getDefinition(f[k]) as Class;
FontLibrary ? Font.registerFont(FontLibrary) : null;
}
break
}
it gets the FontLibrary correctly, but registerFont fails.
http://omgplaylist.com/playa/ is the app, the text on the bottom uses that font, it's loading relatively -
LS.addToLoader('fonts/kroeger05_53.swf', {type:'font', classes:['Kroeger05_53']});
it's not a problem for me yet, i'll be able to do it the way it is but in the future i might need to change it. i've tried checking for a policy file but that didn't do anything because it's actually getting the swf.
thanks for any help.