Dynamic RSL URLs. Is it possible?

796 Views Asked by At

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?

2

There are 2 best solutions below

2
On

yes, you have such option, read this

0
On

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.