PDA

View Full Version : Cannot view images from published applicatio


odoe
06-17-2009, 10:47 PM
Hi there. Still learning Flex and Actionscript, but I have come across an issue I cannot seem to work around. After some reading, I have a feeling it may be a sandbox issue, but have yet to find a resolution.

I portion of my app pulls images from a directory based on a list I have.

I have tried using just an mx component
<mx:Image source="//server1/data/DATA/Images/CCTV/{horizontalList.selectedItem.FileName}" width="75" height="65"/>

Now, this works on my machine, but not when I deploy it to our web server. I have a crossdomain.xml file on the web server the flex app is on.
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
<site-control permitted-cross-domain-policies="all" />
<allow-http-request-headers-from domain="*" headers="*" />
</cross-domain-policy>

server1 is just a file server on our network.
If I make a plain html page pointing the image, it works, so I know my web server can see our network server. I have tried placing the image inside htmlText and tried using Loader like below
var _loader:Loader;
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.C OMPLETE,function(e:Event):void{
_img.source = e.currentTarget.content;
});
_loader.load(new URLRequest(encodeURI("//server1/data/DATA/Images/CCTV/image.png")));


At this point I'm at a loss, as all these methods work from my local machine, even after I've compiled them, but not on our web server.

Even if someone could point me in the right direction, it would be really appreciated. Thank you.

odoe
06-22-2009, 02:56 PM
I was able to solve this problem by creating an IIS virtual directory pointing my images folder.