Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
Bzyku #1
Cross-domain loading module to local application
Crying for help!
I've spend loads of time trying to solve the problem. Googling doesn't
give any solutions, so it's time for the experts :)
I need application running on local machine (swf file on Desktop) to
download a module from server and display it.
So far I can download it, set the applicationDomain, but how to
display it?
Local app.:
================================================== =
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="setup()">
<mx:Script>
<![CDATA[
import mx.events.ModuleEvent;
import mx.controls.Alert;
import flash.system.ApplicationDomain;
import flash.system.Security
import mx.modules.*;
import mx.core.UIComponent;
private var go:String = "http://some.domain/browse.swf";
public var loader:Loader = new Loader();
private var uicomp:UIComponent = new UIComponent();
private var panel:Panel = new Panel();
public function setup():void {
Security.allowDomain("some.domain");
Security.loadPolicyFile("http://some.domain/crossdomain.xml");
handleGo();
}
private function handleGo():void {
var request:URLRequest = new URLRequest(go);
var loaderContext:LoaderContext = new LoaderContext();
loaderContext.applicationDomain = ApplicationDomain.currentDomain;
loaderContext.checkPolicyFile = true;
// loaderContext.securityDomain = SecurityDomain.currentDomain; //
LOCAL SWF files may not set LoaderContext.securityDomain
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE,
modComplete);
loader.contentLoaderInfo.addEventListener(IOErrorE vent.IO_ERROR,
def);
loader.load(request, loaderContext);
}
private function modComplete(event:Event):void{
// Alert.show(loader.contentLoaderInfo.childAllowsPar ent.toString(),
"ch"); // gives TRUE
// Alert.show(loader.contentLoaderInfo.parentAllowsCh ild.toString(),
"p"); // gives TRUE
// Now if I go with following:
uicomp.addChild(loader.content);
panel.addChild(uicomp);
panel.width = 200;
panel.height = 200;
mainCanvas.addChild(panel);
// It showes only a panel but no module content inside :(
}
private function def(event:Event):void{
Alert.show(event.toString(), event.type);
}
]]>
</mx:Script>
<mx:Canvas id="mainCanvas" width="100%" height="100%" />
</mx:Application>
================================================== =
Remote mod.:
================================================== =
<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml"
percentWidth="100" percentHeight="100">
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%"
height="100%" backgroundColor="#ffffff">
<mx:Text text="test text 1"/>
<mx:Text text="test text 2"/>
</mx:HBox>
</mx:Module>
================================================== =
HELP!
Bzyku Guest
-
Issues when loading Flash Player from Local Domain
I have a webcam streaming to Flash Media Server via the Media Encoder. I have published the .swf file with the flash player and... -
Cross domain CF access
'lo all, I'm trying to host my .swf file on one domain, but have the flash remoting call CF on another domain (ie totally separate web servers).... -
Cross domain xml loading
I?m trying to get some xml data loaded into flash across domain. I have the crossdomain.xml file in place and everything works fine in flash player... -
Cross domain sessions
Hi, I'm building a shopping cart system, which is almost complete if it wasn't for this bug (grrr). The site has about 10 domains pointing to it,... -
Cross domain webservice
Hi, We have developed a webservice that retrieves Free/Busy information from the Exchange Server and returns it to the client. The webservice... -
Bzyku #2
Re: Cross-domain loading module to local application
To all interested with the subject:
[url]http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=587&threadid=1248635[/url]
no strait answer at the moment, but I'm not giving up. I'll keep you
posted.
B.
Bzyku Guest



Reply With Quote

