Note that there are some explanatory texts on larger screens.

plurals
  1. POLoading an image from outter resources flash
    primarykey
    data
    text
    <p>After a week of trying different methods, my last resort is to ask you guys about my problem with ActionScript Loader.</p> <p>I cannot load an image from the URL using Loader as it works on my another application. I simply don't know where is the difference in the code. I cannot even debug the content of Loader object because simply trying to peek what's in there throws an exception.</p> <p>My code is:</p> <pre><code>urlLoader = new URLLoader(); urlLoader.dataFormat = URLLoaderDataFormat.BINARY; urlLoader.addEventListener(Event.COMPLETE, onLoadedBytes); urlLoader.addEventListener(IOErrorEvent.IO_ERROR, passEvent); urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, passEvent); urlLoader.load(new URLRequest(url)); </code></pre> <p>Normal loader:</p> <pre><code>loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded); loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, passEvent); loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, passEvent); loader.load(new URLRequest(url), new LoaderContext(true)); </code></pre> <p>Loading related methods:</p> <pre><code>private function onLoadedBytes(e:Event):void { var ba:ByteArray = e.target.data; var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded); loader.loadBytes(ba); } private function onImageLoaded(e:Event):void { _bitmapData = e.target.content.bitmapData; dispatchEvent(new Event(Event.COMPLETE)); } </code></pre> <p>Any idea how to fix it? The domain I try to load an image from is VK Games (<a href="http://vk.com/playfreegames" rel="nofollow">http://vk.com/playfreegames</a>) and the image is app-game related.</p> <p>I've searched the stack for an answer, but none of the solutions presented solved my case.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload