Hi I am a bit stuck here for the past few days. I have a SWF running in Security.LOCAL_TRUSTED sandbox.
I can load my JPEGs and simple SWFs without any problems
var loader:Loader = new Loader();
loader.load(new URLRequest('file:///test.jpg'));
But once, I successfully load a SWF created from an CSS (e.g. myfont.swf) file using Flash Builder 4 (Compile CSS to SWF), then I am unable to load any images or SWFs again as I was before.
The process events are getting fired and looks like its loading but the complete event never gets fired. Neither does any other IOError or Security warning occur.
Can the loaded SWF (myfont.swf) change the sandbox of the loading swf? Or what am I missing here.
CSS for myfont.swf
/* CSS file */
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@font-face {
src: url("../assets/fonts/Arial.ttf");
fontFamily: "Arial";
embedAsCFF: true;
unicodeRange:
U+0000-U+007F,
U+00A0-U+00FF,
U+2000-U+206F,
U+20A0-U+20CF;
}
@font-face {
src: url("../assets/fonts/Arial Bold.ttf");
fontFamily: "Arial";
fontWeight: "bold";
embedAsCFF: true;
unicodeRange:
U+0000-U+007F,
U+00A0-U+00FF,
U+2000-U+206F,
U+20A0-U+20CF;
}
Okay I solved it, how ever I don't understand quite why.
The css/swf files I was loading where not on same directory as the main SWF file.
now that I am loading my font via file://./fonts/arial.swf everything seems to work.
If ever someone else get stuck; Looks like the location of the loaded file matters.
Anyone any ideas why that is?