views:

33

answers:

2

Ok, so here's my problem. I have several SWFs pulled in at runtime from different domains (we're using a CDN). There are some shared fonts within the SWFs.

I'm trying to minimize file sizes as much as possible, so that means either not embedding the fonts in any of those SWFs and setting all their TextFormats at runtime. That's very impractical, and it would be easy to miss some of them.

The other, better option is to use runtime shared libraries to pull in the fonts, but that requires either an absolute URL (goes against the concept of using a CDN), or a relative URL (defeats the purpose of using RSLs in the first place since those resources would be downloaded several times anyway).

Ideally i'd like to be able to tell each SWF at runtime where to pull in the fonts, and give them all the same, dynamic URL.

I can't find anyone who's encountered a similar situation, so i'm not sure if this can or can't be done, but most AS3 problems i find are solved here, so i'm hoping someone knows a good solution for this.

Or is there a 3rd option i'm not considering?

A: 

yes, you have such option, read this

Eugene
Sorry, i guess i wasn't clear enough about the problem.Unless i misunderstood that article, that's not quite what i need.The SWFs that need to have their RSL URLs set at runtime are created in flash (the artists use it for the GUI), not flash builder. Also, the URL needs to be set at runtime. It would be different depending on the user's location, among other things.
Eoin
@Eoin, you've asked very great question, because its very important for platform grow up, so we should look into the way of rewriting application loader with some base RSL and defining the all other RSLs. So take a deep search in this kind of code, i will join a bit later. thanks.
Eugene
+1  A: 

We had this exact problem and finally came up with a solution. It's not pretty but it will work. The basic idea is that when you upload your files, you ignore the RSL and replace it with a blank swf, and instead manually load the contents of the RSL from a dynamic swf.

I posted about how we solved it here: http://blog.bluemammothgames.com/2010/10/runtime-shared-libraries-preload-and.html

If you have any questions, feel free to ping me here or there. As far as I understand, there is no clean way to do it, but this hack works.

Blue Mammoth Games