Well, you'd have to call create() on the factory and then maybe call 
styleDeclarationsChanged on the StyleManagerImpl.

Adobe expects developers to have a copy of the server deployment on their local 
machines.  Then, using relative paths in loadStyleDeclarations should work both 
during local development and when deployed.  If I was worried about my copies 
getting stale, I'd just write a script that downloads the server deployment.  I 
would hope that stuff doesn't change often in ways that affect the code you are 
developing.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: [email protected] [mailto:[email protected]] On Behalf 
Of Aaron Hardy
Sent: Friday, April 10, 2009 12:32 PM
To: [email protected]
Subject: [flexcoders] Loading remote font swf from local application





Hey everyone,

Here at work we deal a lot with loading in font swfs at runtime using 
StyleManager.loadStyleDeclarations().  This works fine when we publish our 
application to the same server as the font swfs, however while debugging the 
application on our local machine it fails when trying to access the remote font 
swfs.  This results in the following error:

Font not found: Unable to load style(SWF is not a loadable module): [address of 
font swf]

This seems to be a known issue dealing with security as seen here:

http://bugs.adobe.com/jira/browse/SDK-15393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel

Our workaround has always been to run a local apache server and then when 
debugging our application during development we make sure the browser points to 
something like http://localhost/MyApp/bin-debug/Main.html.  It's becoming a big 
task to keep everyone's machine in check.  Recently though, Joan Lafferty 
posted a response to the logged ticket which you can read in the link above.  
The example shows that reading the bytes of a module can allow you to import 
the swf in a security-friendly way.  The example is not specific to loading a 
font swf though, it just shows how to load an external module at runtime.  In 
our case, we can load in our font "module" as perscribed but I'm not sure what 
to do after that.  StyleManager.loadStyleDeclarations() automatically makes the 
font available to the application, however, my tests show that just loading the 
font swf "module" using ModuleLoader.loadModule() doesn't cut it.

Can someone fill in the gap here?  Maybe I misunderstood Joan's post.  Thanks!

Aaron

Reply via email to