Loading external images.


  • Posts: 27
Let's say you have some still photographs that you'd like to show in a game or interactive show running in Flash player (not Mobile). You'd like to show them one at a time at a reasonable size. You could make them backgrounds, but that will pump up the size of the swf considerably so that it'll take a while to start up. In Mobile mode I can see Atlases as addressing this kind of problem.

In Flash you could load them as external files. There's a tutorial in AS3 here:

Which makes sense but I can't figure out how that lines up with Stencyl. Is there a way to load backgrounds on the fly?
Anyone have a suggestion here?


  • Posts: 204
To make that code work you should import the needed packages before loading the image, perhaps you can try a code block with this:

import flash.display.Loader;
import flash.system.*;

var request:URLRequest = new URLRequest("http://your.image/url/here.jpg");
var myImage:Loader = new Loader()
org.flixel.FlxG.state.addChildAt(myImage, 0);

Not sure if that would work, but let's give it a try.

Sorry, I didn't notice this was an old post... did you find a solution to your problem?


  • *
  • Posts: 467
Yeah that'd be great if we can get an answer on this, I was wondering about that also.
Visit Reddit's Stencyl page and contribute to spread the word about this amazing program!


  • Posts: 40
I've been wondering the same thing!