Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-26-2008, 03:12 PM   #1
panel
AS3
 
panel's Avatar
 
Join Date: Mar 2007
Location: Warsaw
Posts: 1,991
Send a message via Skype™ to panel
Default Loading image issue

Hi

I have issue with loading images

This works
ActionScript Code:
var loader:Loader = new Loader(); loader.load(new URLRequest("http://l.yimg.com/www.flickr.com/images/tour/hp_1.jpg")); loader.contentLoaderInfo.addEventListener(Event.INIT, onInit); function onInit(evt:Event):void {     addChild(loader) }
Here is sample
http://oceanic.wsisiz.edu.pl/~hamela/Igor/NoBitmap.html

This Do Not Work
If I try to make any changes to image like this
ActionScript Code:
var loader:Loader = new Loader(); loader.load(new URLRequest("http://l.yimg.com/www.flickr.com/images/tour/hp_1.jpg")); loader.contentLoaderInfo.addEventListener(Event.INIT, onInit); function onInit(evt:Event):void {     var bitmap:Bitmap = (evt.target.content);     if (bitmap != null)     {         bitmap.smoothing = true;     }     addChild(bitmap); }

error appears in debug version of FlashPlayer and image never appears ;/

SecurityError: Error #2122: Security sandbox violation: LoaderInfo.content: http://oceanic.wsisiz.edu.pl/~hamela/Igor/Bitmap.swf cannot access http://l.yimg.com/www.flickr.com/images/tour/hp_1.jpg. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
at flash.display::LoaderInfo/get content()
at Bitmap_fla::MainTimeline/onInit()


Here is sample
http://oceanic.wsisiz.edu.pl/~hamela/Igor/Bitmap.html


Last edited by panel; 02-26-2008 at 03:18 PM.
panel is offline   Reply With Quote
Old 02-26-2008, 03:46 PM   #2
jaga
Senior Member
 
Join Date: Nov 2007
Posts: 529
Default

You want to use a LoaderContext when loading, to ensure manipulation outside of the local sandbox..

look up the LoaderContext class, and use it as the 2nd argument in the load() function
jaga is offline   Reply With Quote
Old 02-26-2008, 04:11 PM   #3
panel
AS3
 
panel's Avatar
 
Join Date: Mar 2007
Location: Warsaw
Posts: 1,991
Send a message via Skype™ to panel
Default

Oki dit is and worked

but there is another issue

I am loading images from
ActionScript Code:
[url]www.i.myDomain.com/Image1.jpg[/url]

and now it wants to load crossdomain xml from
ActionScript Code:
[url]www.i.myDomain.com/crossdomain.xml[/url]
Unfortunetly it isn't imposible to put crossdomain file there, becouse this url is created at cahce proxy level, and it's kind of vistual url.

Is there any way to change crossdomain.xml path?
ex for
ActionScript Code:
[url]www.abc.myDomain.com/crossdomain.xml[/url]
panel is offline   Reply With Quote
Old 02-26-2008, 04:30 PM   #4
jaga
Senior Member
 
Join Date: Nov 2007
Posts: 529
Default

Security.loadPolicyFile(url)
jaga is offline   Reply With Quote
Old 02-27-2008, 01:10 PM   #5
panel
AS3
 
panel's Avatar
 
Join Date: Mar 2007
Location: Warsaw
Posts: 1,991
Send a message via Skype™ to panel
Default

Thanks jaga
panel is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Security Sandbox violation....! quahctb ActionScript 2.0 1 09-03-2007 03:52 AM
Cryptic Security Sandbox Violation stray ActionScript 2.0 4 04-09-2007 07:36 PM
Security Sandbox Violation when transforming mc inside MovieClipLoader.onLoadInit isvaljek ActionScript 2.0 1 10-24-2006 04:52 PM
*** Security Sandbox Violation *** Paul Ferrie Other Flash General Questions 2 06-03-2005 07:06 PM
Security SandBox Violation? grizjr ActionScript 2.0 1 08-02-2004 04:13 PM


All times are GMT. The time now is 07:00 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.