This content has been marked as final. Show 3 replies
I have the same problem.
I think this is the answer:
When loading a SWF file from an nontrusted source (such as a domain other than that of the Loader object's root SWF file), you may want to define a mask for the Loader object, to prevent the loaded content (which is a child of the Loader object) from drawing to portions of the Stage outside of that mask, as in the following code:
var rect:Shape = new Shape();
rect.graphics.drawRect(0, 0, 100, 100);
var ldr:Loader = new Loader();
ldr.mask = rect;
var url:String = " http://www.unknown.example.com/content.swf";
var urlReq:URLRequest = new URLRequest(url);
but in the code above (taken from Help) is error.
For anybody who will struggle with that:
you can not use Shape as the parametr in function addChild() adding this to any container in the Application.
First you have to put it in UIComponent:
var myUIComp:UIComponent = new UIComponent;
that way works...
I have seen some flakiness with this as well, particularly when embedding versus loading from an external site. The thing to keep in mind is that your 'stage' may change depending on the trust level maybe? The loaded/embedded SWF uses the Flex stage, not its own. Anyway... it is important to use the 'Set to Content Size' radio button in Flash for most things, and to make sure that registration is in the upper left. I've also seen issues when embedding the same SWF multiple times in the same view/canvas. In general I've always found that loading from my servers usually works fine with an http url, it was always when I tried to load in a local c:\flex projects\my app\ or embed that I saw the most issues....So if worse comes to worst, try switching up how you load the SWF.