Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Posts: 19
Registered: ‎03-08-2011
My Device: Bold 9700
My Carrier: Wind
Accepted Solution

Loading image with Loader


Does anyone knows how to properlly load images from a domain?


i'm trying to load an image from a domain e.g "http://domain.com/image.gif"


When i try locally, it woks fine but when i try to get it from a domain / server, it doesn't work.


here is my sample code.



private function getImage(e:ListEvent):void {	
	imgLoader = new Loader();
	imgLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressActivity);
imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageComplete);
imgLoader.addEventListener(IOErrorEvent.IO_ERROR, onError);
imgLoader.load(new URLRequest(domain+"/eScore/piano/"+e.data.label+".gif"));


 listener functions defined


I also try this without the contentLoaderInfo, how come it works locally and not on a server?



Posts: 146
Registered: ‎03-27-2011
My Device: Blackberry Playbook
My Carrier: WiFi

Re: Loading image with Loader

What about it doesn't work? If you load up the debugger I'm sure it will give you some insight into what is going wrong.

Maybe someone else can provide some more insight into what typically goes wrong with image loading?
If this post solved your problem, please click the 'Accept as Solution' button.
If you found this post useful, please provide a Kudo. Thanks.

Approved Apps: Celestial Slingshot
Posts: 19
Registered: ‎03-08-2011
My Device: Bold 9700
My Carrier: Wind

Re: Loading image with Loader

Thanks for the reply

it doesn't load any images when i try to load directly from e.g "http://mydomain.com/imagefolder/image.gif" but it works when i try to load locally like ""



I found out that i need to put a crossdomain file on the domain server.


for any body wondering below is the xml file i uploaded to my domain. and offcourse replacing mydomain with the real domain address



<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy 
  SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
  <allow-access-from domain="www.mydomain.com" />
  <allow-access-from domain="domain.com" />

 Thanks again Brandon


Posts: 345
Registered: ‎03-13-2011
My Device: Playbook
My Carrier: n/a

Re: Loading image with Loader

nikiben, if you solved the issue please mark your post as the solution