I can't figure out how to download all array(~10 pic) of images and then use them on screen. The problem is that in order not to weight the server, the pictures should be downloaded one time.
Now I load images like this: [code specially without the array just for example]
var shirt1 = String("https://static.topsport.lt/sites/all/themes/topsport2/files/images/marskineliai_png/215.png");
var img1Request:URLRequest = new URLRequest(shirt1);
var img1Loader:Loader = new Loader();
img1Loader.load(img1Request);
myMovieClip.removeChildAt(0);
myMovieClip.addChild(img1Loader);
I'm thinking about somehow in one flash keyframe as3 code load all images, and in second add load images to screen.
p.s. I add and remove array of Child's for the same movieclip symbol.
[edit] Here's that I try to compile:
FRAME 1
function startLoad(e:Event = null):void {
var marsk1 = String("https://static.topsport.lt/sites/all/themes/topsport2/files/images/marskineliai_png/215.png");
var img1Request:URLRequest = new URLRequest(marsk1);
var img1Loader:Loader = new Loader();
img1Loader.load(img1Request);
myMovieClip.removeChildAt(0);
if(_2 != null){
myMovieClip.smoothing = true;}
//myMovieClip.addChild(img1Loader).addEventListener(Event.COMPLETE, startLoad);
function achild(){
myMovieClip.addChild(img1Loader);
}
}
FRAME 2
achild().addEventListener(Event.COMPLETE, startLoad);
I tried to apply my situation to Andrey Popov suggestion. Can I import the function from the previous frame? Because I'am trying to do it and I get method not found